mint M,x;ll H,N;{rd(M);for(x=1;cin>>H&&H;x/=++N)M+=~H;x*=M+1+(1..N);if(x)wt(x);else wt("NA");}