#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
int a[maxn], mod = 1e9 + 7;
unordered_map<int, int> dp[3];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    dp[i & 1].clear();
    for (auto it : dp[!(i & 1)]) {
      int j = it.first;
      int x = it.second;
      dp[i & 1][j + a[i]] = (dp[i & 1][j + a[i]] + x) % mod;
      dp[i & 1][j - a[i]] = (dp[i & 1][j - a[i]] + x) % mod;
    }
    ans = (ans + dp[i & 1][0]) % mod;
    dp[i & 1][0]++;
  }
  cout << ans;
  return 0;
}
