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