#include <bits/stdc++.h>
using namespace std;
int dp[1010][20010];
int n, m;
long long ans;
int a[1100];
int idx(int x) { return x + 10000; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    ans = (ans + dp[i - 1][idx(a[i])]) % 1000000007;
    ans = (ans + dp[i - 1][idx(-a[i])]) % 1000000007;
    for (int j = 10000 - a[i]; j >= -10000; j--)
      dp[i][idx(j + a[i])] =
          (dp[i][idx(j + a[i])] + dp[i - 1][idx(j)]) % 1000000007;
    for (int j = -10000 + a[i]; j <= 10000; j++)
      dp[i][idx(j - a[i])] =
          (dp[i][idx(j - a[i])] + dp[i - 1][idx(j)]) % 1000000007;
    dp[i][idx(a[i])]++;
    dp[i][idx(-a[i])]++;
  }
  printf("%d\n", (int)(ans % 1000000007));
  return 0;
}
