import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { solver(); } final static long MOD = 1_000_000_007; static void solver() { Scanner sc = new Scanner(System.in); int m = Integer.parseInt(sc.nextLine()); String[] s = sc.nextLine().split(" "); int[] num = new int[s.length]; int res = m; for (int i = 0; i < s.length; i++) { num[i] = new Integer(s[i]); res -= num[i]; } if (num[0] == 0) { System.out.println(1); return; } int n = num.length; res -= n - 1; if (res >= 0) { System.out.println(nCk(res + n , res)); } else { System.out.println("NA"); } } static long nCk(int n, int k) { if (n < k) return 0; else { return (fact(n) % MOD * inv(fact(n - k), MOD) % MOD * inv(fact(k), MOD) % MOD); } } static long fact(int n) { long ans = 1; for (int i = 1; i <= n; i++) { ans *= i; ans %= MOD; } return ans; } static void tr(Object... o) { System.out.println(Arrays.deepToString(o)); } static long inv(long a, long mod) { a = a % mod; long b = mod; long p = 1, q = 0; while (b > 1) { long c = b / a; b = b % a; q = q - p * c; long d = b; b = a; a = d; d = p; p = q; q = d; } while (q < 0) q += mod; return q; } }