#include <bits/stdc++.h>
using namespace std;
unordered_map<long long, long long> dp[3];
int32_t main() {
  long long n;
  cin >> n;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    for (auto x : dp[0]) {
      if (x.first + a[i] <= 5000)
        dp[1][x.first + a[i]] = (dp[1][x.first + a[i]] + x.second) % 1000000007;
      if (x.first - a[i] >= -5000)
        dp[1][x.first - a[i]] = (dp[1][x.first - a[i]] + x.second) % 1000000007;
    }
    dp[1][a[i]]++;
    dp[1][-a[i]]++;
    if (dp[1].count(0)) ans = (ans + dp[1][0]) % 1000000007;
    dp[0] = dp[1];
    dp[1].clear();
  }
  cout << ans << endl;
  return 0;
}
