#include <bits/stdc++.h>
using namespace std;
int a[1003];
int dp[1003][20008][2];
int M = 10004;
int mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  dp[0][M][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = a[i]; j <= 20000 - a[i]; j++) {
      dp[i][j][1] += dp[i - 1][j - a[i]][1];
      dp[i][j][1] %= mod;
      dp[i][j][1] += dp[i - 1][j + a[i]][1];
      dp[i][j][1] %= mod;
      dp[i][j][1] += dp[i - 1][j - a[i]][0];
      dp[i][j][1] %= mod;
      dp[i][j][1] += dp[i - 1][j + a[i]][0];
      dp[i][j][1] %= mod;
      dp[i][j][0] += dp[i - 1][j][0];
      dp[i][j][0] %= mod;
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += dp[i][M][1];
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
