import sequtils,algorithm,math,strutils template times*(n:int,body) = (for _ in 0.." .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord let m = scan() let H = stdin.readLine().split().map(parseInt) if H.len == 1 : if H[0] == 0: quit "1",0 let n = m - (H.sum() - H.len) let h = H.len() let k = n - (h + h - 1) if k < 0: quit "NA",0 if k == 0 : quit "1",0 # h箇所にk個入れる組み合わせ echo (h+k).combinationWithMod(h)