#include <bits/stdc++.h>
using namespace std;
const int N = 1e3, O = 1e4 + 1, M = 1e9 + 7;
int n, dp[N][2 * O][2], a[N];
int calc(int at, int w, bool f) {
  if (at == n) return !w && f;
  int &res = dp[at][w + O][f];
  if (res != -1) return res;
  res = !w && f;
  if (!f) res = (res + calc(at + 1, w, f)) % M;
  res = (res + calc(at + 1, w - a[at], true)) % M;
  res = (res + calc(at + 1, w + a[at], true)) % M;
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  memset(dp, -1, sizeof dp);
  printf("%d\n", calc(0, 0, false));
  return 0;
}
