n = int(input()) P = list(map(int, input().split())) mod = 10**9+7 n0, n1 = 0, 0 for p in P: if p < 50: n0 += 1 elif p > 50: n1 += 1 if n1 == 0: print(0) else: ans = pow(2, n0+n1-1, mod) print(ans)