#include <bits/stdc++.h>
const int N = 10000 + 10;
const int mod = 1e9 + 7;
int cnt[N + N], tmp[N + N];
void addIt(int &x, int val) {
  x += val;
  if (x >= mod) x -= mod;
}
int main() {
  int n;
  scanf("%d", &n);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    addIt(ans, cnt[x + N]);
    addIt(ans, cnt[-x + N]);
    for (int j = 0; j < N + N; j++) {
      if (j + x < N + N) addIt(tmp[j + x], cnt[j]);
      if (j - x > 0) addIt(tmp[j - x], cnt[j]);
    }
    tmp[x + N] += 1;
    tmp[-x + N] += 1;
    for (int j = 0; j < N + N; j++) {
      cnt[j] = tmp[j];
      tmp[j] = 0;
    }
  }
  printf("%d\n", ans);
  return 0;
}
