#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
const int MAXN = 1005;
const int MAXS = 11005;
const long long MOD = 1e9 + 7;
int n;
int A[MAXN];
long long dp[MAXN][2 * MAXS];
int in(int x) {
  if (x < 0) return (-x + MAXS);
  return x;
}
void input() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> A[i];
}
void solve() {
  long long ans = 0;
  int g;
  for (int i = -MAXS + 1; i < MAXS; i++) dp[0][in(i)] = 0;
  for (int i = 1; i <= n; i++) {
    dp[i - 1][0]++;
    dp[i - 1][0] %= MOD;
    for (int s = -MAXS; s < MAXS; s++) {
      dp[i][in(s)] = dp[i - 1][in(s - A[i])] + dp[i - 1][in(s + A[i])];
      dp[i][in(s)] %= MOD;
    }
    ans += dp[i][0];
    ans %= MOD;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  input();
  solve();
  return 0;
}
