#include <bits/stdc++.h>
using namespace std;
const long long MAX = 3e4 + 10;
long long inf = (long long)3e15;
long long mod = (long long)1e9 + 7;
long long sz = 500, timer = 0;
long long dp[1004][MAX];
long long n, a[MAX];
long long ans = 0;
long long dif = 1e4 + 25;
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    for (int j = -1e4 - 10; j <= 1e4 + 10; j++) {
      if (j + dif + a[i] < MAX) dp[i][j + dif] += dp[i - 1][j + dif + a[i]];
      if (j + dif - a[i] >= 0) dp[i][j + dif] += dp[i - 1][j + dif - a[i]];
      dp[i][j + dif] %= mod;
    }
    ans += dp[i][dif];
    dp[i][a[i] + dif]++;
    dp[i][-a[i] + dif]++;
  }
  ans %= mod;
  cout << ans;
}
int main() {
  ios::sync_with_stdio(0);
  long long q;
  q = 1;
  while (q--) {
    solve();
  }
  return 0;
}
