def modpow(s,q,mod): ret = 1 while q > 0: if q % 2 == 1: ret = (s * ret) % mod s = (s * s) % mod q = q/2 return ret x = input() a = map(int,raw_input().split()) for i in xrange(len(a)): x = x - a[i] + 1 if x < len(a)+len(a)-1: print "NA" else: b = len(a)+1 c = x-len(a)-len(a)+1 d = 1 for i in xrange(b,b+c): d *= i d %= 1000000007 for i in xrange(1,c+1): d *= modpow(i,1000000005,1000000007) d %= 1000000007 print d