#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int shift = 1e4 + 10;
const int sz = 1001;
int dp[2][shift * 2 + 100];
int a[sz];
int main() {
  int lvl = 0, n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    lvl = 1 - lvl;
    for (int j = 0; j < shift * 2 + 100; j++) dp[lvl][j] = 0;
    for (int sum = 0; sum < shift * 2; sum++) {
      if (dp[1 - lvl][sum] != 0)
        for (int sign = -1; sign <= 1; sign += 2)
          dp[lvl][sum + a[i] * sign] =
              (dp[lvl][sum + a[i] * sign] + dp[1 - lvl][sum]) % mod;
    }
    dp[lvl][a[i] + shift]++;
    dp[lvl][-a[i] + shift]++;
    ans = (ans + dp[lvl][shift]) % mod;
  }
  cout << ans;
}
