import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines MOD=10**9+7 MAX=10**6 f=[1]*(MAX+1) invf=[1]*(MAX+1) for i in range(2, MAX+1): f[i]=f[i-1]*i%MOD invf[MAX]=pow(f[MAX], MOD-2, MOD) for i in range(MAX-1, -1, -1): invf[i]=invf[i+1]*(i+1)%MOD def comb(x, y): if not (0<=y and y<=x): return 0 return f[x]*invf[y]*invf[x-y]%MOD m=int(readline()) h=list(map(int, readline().split())) if h[0]==0: print(1) exit() k=len(h) s=sum(h) ans=comb(m-s+1, k) if ans==0: print("NA") else: print(ans)