mod = 1000000007 def modpow(s,q): 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()) l = len(a) for i in xrange(l): x = x - a[i] + 1 if a[0] == 0: print 1 elif x < l*2-1: print "NA" else: d = 1 for i in xrange(l+1,x-l+2): d *= i*modpow(i-l,mod-2) d %= mod print d