#include <bits/stdc++.h>
using namespace std;
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class T>
void debug(T a, T b) {
  cerr << "[";
  for (T i = a; i != b; ++i) {
    if (i != a) cerr << ", ";
    cerr << *i;
  }
  cerr << "]\n";
}
const int N = 1005;
const int S = 20005;
const int OFFSET = 10000;
const int mod = (int)1e9 + 7;
inline void add(int& x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int a[N];
int dp[N][S][2];
int n;
int go(int idx, int sum, bool on) {
  if (idx == n) {
    return sum == 0;
  }
  int& ret = dp[idx][sum + OFFSET][on];
  if (~ret) return ret;
  ret = 0;
  if (!on) {
    ret = go(idx + 1, sum, on);
  } else {
    ret = go(idx + 1, sum, false);
    add(ret, go(idx + 1, sum + a[idx], true));
    add(ret, go(idx + 1, sum - a[idx], true));
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < (n); ++i) cin >> a[i];
  memset(dp, -1, sizeof(dp));
  int ans = 0;
  for (int i = 0; i < (n); ++i) {
    add(ans, go(i, 0, true));
    add(ans, mod - 1);
  }
  cout << ans << "\n";
  return 0;
}
