#include <bits/stdc++.h>
using namespace std;
int A[(1 << 14)];
int R[2][2][(1 << 14)];
int main() {
  int n;
  scanf("%d", &n);
  int i, j, k, l;
  for (i = (0); i < (n); ++i) scanf("%d", &A[i]);
  int sum = 0;
  int res = 0;
  memset(R, 0, sizeof(R));
  R[0][0][0] = 1;
  for (i = (0); i < (n); ++i) {
    int prev = i & 1;
    int next = prev ^ 1;
    memset(R[next], 0, sizeof(R[next]));
    for (j = (0); j < (2); ++j)
      for (k = (0); k < (sum + 1); ++k)
        if (R[prev][j][k] != 0) {
          if (j == 0) {
            R[next][j][k] += R[prev][j][k];
            if (R[next][j][k] >= 1000000007) R[next][j][k] -= 1000000007;
          } else if (k == 0) {
            res += R[prev][j][k];
            if (res >= 1000000007) res -= 1000000007;
          }
          for (l = (0); l < (2); ++l) {
            int value = k;
            if (l == 0)
              value += A[i];
            else
              value -= A[i];
            value = abs(value);
            R[next][1][value] += R[prev][j][k];
            if (R[next][1][value] >= 1000000007)
              R[next][1][value] -= 1000000007;
          }
        }
    sum += A[i];
  }
  res += R[n & 1][1][0];
  res %= 1000000007;
  printf("%d\n", res);
  return 0;
};
