using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ int N = A.Length ; if(A.Length == 1 && A[0] == 0){ Console.WriteLine(1); return; } int sum = A.Sum() + (N-1); if(sum > M){ Console.WriteLine("NA"); return; } int rest = M - sum; modComb.Init((int)2e6); Console.WriteLine(modComb.nCrMod(rest + N,N)); } int M; int[] A; public Sol(){ M = ri(); A = ria(); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);} static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} } class modComb{ public static long mod=(long)(1e9+7); public static long nCrMod(long n,long r){ if(n0){ if((k&1)==1){ret*=x;ret%=mod;} x*=x;x%=mod; k>>=1; } return ret; } public static long InvMod(long n){ //(mod-2)乗を返す // modが素数の時だけ!!!! return PowMod(n,mod-2); } }