#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long dp[1010][20010];
int a[1010];
int main() {
  int n;
  cin >> n;
  int m = 10000;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) dp[i][a[i] + m] = 1, dp[i][m - a[i]] = 1;
  for (int i = 1; i < n; ++i)
    for (int j = -m; j < m + 1; ++j)
      dp[i][j + m] =
          (dp[i][j + m] + (j + m - a[i] < 0 ? 0 : dp[i - 1][j - a[i] + m]) +
           (j + m + a[i] > 2 * m ? 0 : dp[i - 1][j + a[i] + m])) %
          MOD;
  long long sum = 0;
  for (int i = 0; i < n; ++i) sum = (sum + dp[i][m]) % MOD;
  cout << sum << endl;
}
