m = int(input()) a = list(map(int,input().split())) N = 1000010 mod = 1000000007 fac = [1] * N finv = [1] * N inv = [1] * N for i in range(2, N): fac[i] = fac[i - 1] * i % mod inv[i] = mod - inv[mod % i] * (mod // i) % mod finv[i] = finv[i - 1] * inv[i] % mod def com(n, k): if n < k: exit(0) if n < 0 or k < 0: exit(0) return fac[n]*(finv[k]*finv[n - k]%mod) %mod def calc(n, k): return com(n + k - 1, n) s = len(a) ans = calc(m - (sum(a) + s - 1), s + 1) if ans == 0: print("NA") else: print(ans)