#include <bits/stdc++.h>
using namespace std;
long long D[1010][20200], sol;
int a[1010], i, n, j;
int main() {
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> a[i];
  D[0][10000] = 1;
  for (i = 1; i <= n; ++i) {
    for (j = a[i]; j <= 20000; ++j) {
      D[i][j - a[i]] += D[i - 1][j];
      if (D[i][j - a[i]] >= 1000000007) D[i][j - a[i]] -= 1000000007;
    }
    for (j = 20000 - a[i]; j >= 0; --j) {
      D[i][j + a[i]] += D[i - 1][j];
      if (D[i][j + a[i]] >= 1000000007) D[i][j + a[i]] -= 1000000007;
    }
    sol += D[i][10000];
    D[i][10000]++;
    if (D[i][10000] >= 1000000007) D[i][10000] -= 1000000007;
    if (sol >= 1000000007) sol -= 1000000007;
  }
  cout << sol;
  return 0;
}
