#include const int Mod = 1000000007; int main() { int i, N, P[101]; scanf("%d", &N); for (i = 1; i <= N; i++) scanf("%d", &(P[i])); int j, k, cur, prev, dp[2][101][2] = {}; for (i = 1, cur = 1, prev = 0, dp[0][0][0] = 1; i <= N; i++, cur ^= 1, prev ^= 1) { for (j = 0, dp[cur][0][0] = 0, dp[cur][0][1] = 0; j < i; j++) { dp[cur][j][0] += dp[prev][j][0]; if (dp[cur][j][0] >= Mod) dp[cur][j][0] -= Mod; dp[cur][j][1] += dp[prev][j][1]; if (dp[cur][j][1] >= Mod) dp[cur][j][1] -= Mod; if (P[i] > 50) { dp[cur][j+1][0] = dp[prev][j][1]; dp[cur][j+1][1] = dp[prev][j][0]; } else if (P[i] < 50) { dp[cur][j+1][0] = dp[prev][j][0]; dp[cur][j+1][1] = dp[prev][j][1]; } } } long long ans = 0; for (j = 1; j <= N; j++) ans += dp[prev][j][1]; printf("%lld\n", ans % Mod); fflush(stdout); return 0; }