import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.nextLine()); String[] s = sc.nextLine().split(" "); int K = s.length; int[] H = new int[K]; for (int i = 0; i < K; i++) { H[i] = Integer.parseInt(s[i]); N -= H[i]; } N++; if (H[0] == 0) { System.out.println(1); } else if (K < 0 || N <= 0) { System.out.println("NA"); } else { System.out.println(combMod(N, K, 1000000007)); } } public static long combMod(long n, long r, long mod) { long comb = 1; for (int i = 0; i < r; i++) { comb = (comb * (n - i)) % mod; comb = (comb * inverse(r - i, mod)) % mod; } return comb; } public static long[] extgcd(long a, long b) { long u = 1; long v = 0; long x = 0; long y = 1; while (a > 0) { long q = b / a; x -= q * u; y -= q * v; b -= q * a; long tmp; tmp = x; x = u; u = tmp; tmp = y; y = v; v = tmp; tmp = b; b = a; a = tmp; } return new long[] { b, x, y }; } public static long inverse(long n, long mod) { long[] gcd = extgcd(n, mod); if (gcd[0] == 1) { return (gcd[1] + mod) % mod; } else { return 0; } } }