#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200001;
const long long mod = 1e9 + 7;
int a[MAXN], n;
long long dp[1001][20005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    dp[i][10000 - a[i]]++;
    dp[i][10000 + a[i]]++;
    for (int diff = 0; diff <= 20000; diff++) {
      int cand1 = diff - a[i + 1];
      int cand2 = diff + a[i + 1];
      if (cand1 > 0) {
        dp[i + 1][cand1] += dp[i][diff];
        dp[i + 1][cand1] %= mod;
      }
      if (cand2 <= 20000) {
        dp[i + 1][cand2] += dp[i][diff];
        dp[i + 1][cand2] %= mod;
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += dp[i][10000];
    ans %= mod;
  }
  cout << ans;
  return 0;
}
