#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 5, S = 10000 + 5, P = 1e9 + 7;
int n, a[N], dp[N][S << 1];
void readInput() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
}
void solve() {
  for (int i = n - 1; ~i; i--) {
    dp[i][S + a[i]] = dp[i][S - a[i]] = 1;
    for (int j = 0; j < S + S; j++) {
      if (j >= a[i]) (dp[i][j] += dp[i + 1][j - a[i]]) %= P;
      if (j + a[i] < S + S) (dp[i][j] += dp[i + 1][j + a[i]]) %= P;
    }
  }
}
void writeOutput() {
  int ans = 0;
  for (int i = 0; i < n; i++) (ans += dp[i][S]) %= P;
  cout << ans << endl;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  readInput(), solve(), writeOutput();
  return 0;
}
