#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007, dp[2][22001] = {0};
int main() {
  int n, a[1001];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int cnt = 1, ans = 0;
  for (int f = 0; cnt <= n; f = !f, cnt++) {
    for (int j = 1000; j <= 21000; j++) {
      dp[f][j] = dp[!f][j - a[cnt]] + dp[!f][j + a[cnt]];
      dp[f][j] %= mod;
    }
    dp[f][11000 - a[cnt]]++;
    dp[f][11000 + a[cnt]]++;
    ans = (ans + dp[f][11000]) % mod;
  }
  cout << ans;
  return 0;
}
