#include <bits/stdc++.h>
using namespace std;
long long P = 1e9 + 7;
long long P1 = 1e9 + 9;
const int sqr = 500;
const int arrn = 5e5 + 5;
const int arrn2 = 6e3 + 5;
void solve() {
  int n;
  cin >> n;
  vector<int> in(n);
  for (int i = 0; i < n; i++) cin >> in[i];
  vector<vector<long long>> proc(n, vector<long long>(20001, 0));
  long long tot = 0;
  for (int i = 0; i < n; i++) {
    proc[i][10000 + in[i]] = 1;
    proc[i][10000 - in[i]] = 1;
    if (i > 0) {
      for (int j = in[i]; j < 20001 - in[i]; j++) {
        proc[i][j + in[i]] += proc[i - 1][j];
        proc[i][j + in[i]] %= P;
        proc[i][j - in[i]] += proc[i - 1][j];
        proc[i][j - in[i]] %= P;
      }
    }
    tot += proc[i][10000];
    tot %= P;
  }
  if (tot < 0) tot += P;
  cout << tot;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
