#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010, maxt = 10010, mod = 1e9 + 7;
long long n, a[maxn], ans, dp[maxn][maxt * 2 + 1];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  dp[0][a[0] + maxt]++;
  dp[0][-a[0] + maxt]++;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < maxt + maxt; j++) {
      if (j + a[i] < maxt * 2)
        dp[i][j] = (dp[i][j] + dp[i - 1][j + a[i]]) % mod;
      if (j - a[i] >= 0) dp[i][j] = (dp[i][j] + dp[i - 1][j - a[i]]) % mod;
    }
    dp[i][a[i] + maxt]++;
    dp[i][-a[i] + maxt]++;
    ans = (ans + dp[i][maxt]) % mod;
  }
  cout << ans << endl;
  return 0;
}
