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