#include <bits/stdc++.h>
using namespace std;
const long long NMAX = 1001;
const long long INF = (1LL << 60) - 1;
const long long MOD = 1000000007;
const long long BLOCK = 101;
const long long nr_of_bits = 30;
const long long lim = 10000;
long long dp[NMAX][2 * lim + 5];
long long n;
void add(long long &x, long long val) {
  x += val;
  if (x >= MOD) {
    x -= MOD;
  }
  if (x < 0) {
    x += MOD;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, x;
  cin >> n;
  long long sum = 0;
  dp[0][lim] = 1;
  for (i = 1; i <= n; i++) {
    cin >> x;
    for (long long j = -lim + x; j <= lim; j++) {
      add(dp[i][j + lim], dp[i - 1][j - x + lim]);
    }
    for (long long j = -lim; j <= lim - x; j++) {
      add(dp[i][j + lim], dp[i - 1][j + x + lim]);
    }
    add(sum, dp[i][lim]);
    add(dp[i][lim], 1);
  }
  cout << sum;
  return 0;
}
