#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const int maxn = (int)1e3 + 5;
const int logn = 21;
const int sqrtn = 3e2 + 5;
int n, dn[maxn][maxn * 20], q[maxn];
int f(int cur, int sum) {
  if (cur > n) return (sum == 10000);
  int &ret = dn[cur][sum];
  if (ret != -1) return ret;
  ret = (sum == 10000);
  ret += f(cur + 1, sum + q[cur]);
  ret %= mod;
  ret += f(cur + 1, sum - q[cur]);
  ret %= mod;
  return ret;
}
int main() {
  memset(dn, -1, sizeof dn);
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &q[i]);
  int ans = 0;
  for (int i = 1; i < n; i++) {
    ans += f(i + 1, 10000 + q[i]);
    ans %= mod;
    ans += f(i + 1, 10000 - q[i]);
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
