import java.util.*; public class Main { public static long MOD = (long)Math.pow(10, 9) + 7; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long m = sc.nextLong(); ArrayList h = new ArrayList(); long sum = 0; for(int i = 0; i < 1000000; i++) { try { long t = sc.nextLong(); sum += t; h.add(t); } catch(Exception e) { break; } } long k = h.size(); sum += (k - 1); long ans = 1; if(h.get(0) != 0) { if(sum > m) { System.out.println("NA"); } else { long t = m - sum; long r1 = 1; long r2 = 1; for(long i = 1; i <= k; i++) { r1 = (r1 * (t + i)) % MOD; r2 = (r2 * i) % MOD; } long r3 = func(r2, MOD - 2); ans = (r1 * r3) % MOD; System.out.println(ans); } } else { System.out.println(1); } } public static long func(long a, long x) { if(x == 1) return 1; if(x % 2 == 0) { long t = func(a, x / 2); return (t * t) % MOD; } else { long t = func(a, x / 2); t = (t * t) % MOD; return (a * t) % MOD; } } }