N=int(input()) P=list(map(int,input().split())) K=0 for p in P: if p!=50: K+=1 if K==0: print(0) else: print(pow(2,K-1,10**9+7))