#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007, maxf = 22000, maxn = 1010;
int f[2][maxf], num[maxn], n;
long long ans;
int main() {
  while (scanf("%d", &n) == 1) {
    for (int i = 1; i <= n; i++) scanf("%d", &num[i]);
    memset(f, 0, sizeof(0));
    int k = 0;
    ans = 0;
    for (int i = 1; i <= n; i++) {
      k ^= 1;
      for (int j = 1000; j <= 21000; j++)
        f[k][j] = (f[!k][j - num[i]] + f[!k][j + num[i]]) % mod;
      f[k][11000 + num[i]]++;
      f[k][11000 - num[i]]++;
      ans = (ans + f[k][11000]) % mod;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
