mint x;ll M,H,N;{rd(M);for(x=1;cin>>H;x/=++N)M-=H;x*=M+(2-N..!!H);printf(x?"%d":"NA",H=x);}