using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _4.takmicenje
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = Convert.ToInt32(s[0]);
            int k = Convert.ToInt32(s[1]);
            string[] str = Console.ReadLine().Split();
            long z = 0;
            long[] niz = new long[n];
            for (int i = 0; i < n; i++)
            {
                niz[i] = Convert.ToInt64(str[i]);
                z += niz[i];
            }
            Console.Write(z % (Math.Pow(10, 9) + 7));
            Console.ReadKey();
        }
    }
}