# -*- coding: utf-8 -*- """ Created on Sun Aug 1 14:59:24 2021 @author: sumitacchan """ N = int(input()) P = list(map(int, input().split())) mod = 10**9+7 n0 = 0 n1 = 0 n2 = 0 for x in P: if x < 50: n0 += 1 elif x == 50: n1 += 1 elif x > 50: n2 += 1 ans = 0 if n2 > 0: ans = 1 << (n0 + n2 - 1) ans %= mod print(ans)