MOD = 10 ** 9 + 7 n = int(input()) plst = list(map(int, input().split())) tf = any(p > 50 for p in plst) if tf: print(pow(2, n - 1, MOD)) else: print(0)