M = input() H = map(int, raw_input().split()) H = filter(lambda x: x > 0, H) ans = 0 mod = int(1e+9 + 7) fact = [0] * (10**6 + 10) fact[0] = 1 S = sum(H) n = len(H) def powmod(x, p): res = 1 tmp = x while p > 0: if p & 1: res *= tmp res %= mod tmp = tmp * tmp tmp %= mod; p = p >> 1; return res for i in xrange(M + 5): fact[i + 1] = (i + 1) * fact[i] fact[i + 1] %= mod; if S + (n - 1) > M: print "NA" else: a = fact[M - S + 1] b = fact[n] c = fact[M - S + 1 - n] ans = a * powmod((b * c) % mod, mod - 2) ans %= mod print ans