#include <bits/stdc++.h>
using namespace std;
int n, d[1009], memo[1009][20013];
int f(int k, int s) {
  if (memo[k][s + 10000] != -1) return memo[k][s + 10000];
  int r = 0;
  if (s == d[k]) r = 1;
  if (s == ((-1) * d[k])) r = 1;
  if (k < n) r += ((f(k + 1, s - d[k]) + f(k + 1, s + d[k])) % 1000000007);
  return memo[k][s + 10000] = r;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> d[i];
  memset(memo, -1, sizeof memo);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += f(i, 0);
    ans %= 1000000007;
  }
  cout << ans << endl;
}
