MOD = 10**9 + 7 N = int(input()) P = list(map(int, input().split())) a_count = 0 # number of coins with p_i < 50 (s_i = +1) b_count = 0 # number of coins with p_i > 50 (s_i = -1) for p in P: if p < 50: a_count += 1 elif p > 50: b_count += 1 if b_count == 0: print(0) else: # The answer is 2^(a_count + b_count - 1) mod MOD exponent = a_count + b_count - 1 print(pow(2, exponent, MOD))