mod = 10**9 + 7 N = int(input()) p = list(map(int,input().split())) p = [i - 50 for i in p] dp = [[0]*10002 for _ in range(N)] def f(x): if x>= 0: return x else: return 10002+x dp[0][f(p[0])] += 1 dp[0][0] += 1 for i in range(N-1): a = p[i+1] for j in range(-4950,5001): dp[i+1][f(j)] += dp[i][f(j - a)] dp[i+1][f(j)] += dp[i][f(j)] dp[i+1][f(j)] %= mod ans = 0 for i in range(1,5001): ans += dp[N-1][i] ans %= mod print(ans)