#include <bits/stdc++.h>
using namespace std;
int n, A[1005], dp[1005][20005];
int solve(int x, int sum) {
  int &ret = dp[x][sum + 10000];
  if (ret != -1) return ret;
  if (x == n + 1) return ret = !sum;
  return ret = ((long long)solve(x + 1, sum + A[x]) + solve(x + 1, sum - A[x]) +
                !sum) %
               1000000007;
}
int main() {
  int ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", A + i);
  memset(dp, -1, sizeof dp);
  for (int i = 1; i <= n; i++)
    ans = ((long long)solve(i, 0) - 1 + ans) % 1000000007;
  cout << ans << endl;
  return 0;
}
