#include <bits/stdc++.h>
using namespace std;
int a[1111];
long long olddp[44444];
long long dp[44444];
int main() {
  int j, i, n;
  long long sum = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 0; i <= 20000; i++) olddp[i] = 0;
  for (i = 1; i <= n; i++) {
    for (j = 0; j <= 20000; j++) dp[j] = 0;
    dp[a[i] + 10000]++;
    dp[-a[i] + 10000]++;
    for (j = 0; j <= 20000; j++) {
      dp[j + a[i]] = (dp[j + a[i]] + olddp[j]) % 1000000007;
      if (j - a[i] >= 0) dp[j - a[i]] = (dp[j - a[i]] + olddp[j]) % 1000000007;
    }
    for (j = 0; j <= 20000; j++) {
      olddp[j] = dp[j];
    }
    sum = (sum + dp[10000]) % 1000000007;
  }
  cout << sum << endl;
  return 0;
}
