#include <bits/stdc++.h>
using namespace std;
long long t, n, m, u, v, q, r, ql, qr, k, l, s, w, z, x, y, d, p, c, L, b;
const int N = 1e3 + 5;
const int NN = 1e4 + 4;
const long long mod = 1e9 + 7;
const long long INF = 1LL << 52LL;
int a[N], dp[N][2 * NN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    dp[i][NN] = 1;
  }
  dp[0][NN] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < 2 * NN; ++j) {
      if (j - a[i] >= 0) dp[i][j] += dp[i - 1][j - a[i]];
      if (dp[i][j] >= mod) dp[i][j] -= mod;
      if (j + a[i] < 2 * NN) dp[i][j] += dp[i - 1][j + a[i]];
      if (dp[i][j] >= mod) dp[i][j] -= mod;
    }
  }
  long long sol = 0;
  for (int i = 1; i <= n; ++i) sol += dp[i][NN] - 1;
  sol %= mod;
  cout << sol << '\n';
  return 0;
}
