mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) big = 0 small = 0 for a in A: if a > 50: big += 1 elif a < 50: small += 1 if big + small == 0: print(0) else: if big: print(pow(2, big + small - 1, mod)) else: print(0) if __name__ == '__main__': main()