#include <bits/stdc++.h>
using namespace std;
int dp[1010][20200];
int n, m, p, q;
int a[1010];
int sum;
const int mod = 1000000007;
int main() {
  scanf("%d", &n);
  sum = 0;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), sum += a[i];
  memset(dp, 0, sizeof dp);
  dp[0][0 + sum] = 1;
  for (int i = 1; i <= n; i++) dp[i][0 + sum] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = -sum; j <= sum; j++)
      if (dp[i - 1][j + sum]) {
        dp[i][j + sum + a[i]] += dp[i - 1][j + sum];
        dp[i][j + sum + a[i]] %= mod;
        dp[i][j + sum - a[i]] += dp[i - 1][j + sum];
        dp[i][j + sum - a[i]] %= mod;
      }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) ans += dp[i][0 + sum] - 1, ans %= mod;
  cout << ans << endl;
  return 0;
}
