n=int(input()) a=list(map(int,input().split())) c=0 d=0 for i in a: if i<50: c+=1 if i>50: d+=1 if c==0: print(0) else: print(pow(2,c+d-1,10**9+7))