#include <bits/stdc++.h>
using namespace std;
template <typename T, typename T2>
ostream &operator<<(ostream &s, const pair<T, T2> &p) {
  return s << "(" << p.first << "," << p.second << ")";
}
template <typename T, typename T2>
istream &operator>>(istream &s, const pair<T, T2> &p) {
  return s >> p.first >> p.second;
}
template <typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
  for (auto it : v) s << it << " ";
  return s;
}
template <typename T>
void read_input(T beg, T end) {
  while (beg != end) cin >> *beg++;
}
struct debugger {
  template <typename T>
  debugger &operator,(const T &v) {
    cerr << v << ", ";
    return *this;
  }
} dbg;
int ar[1010];
int dp[1010][20010];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> ar[i];
  dp[0][10000 - ar[0]] = 1;
  dp[0][10000 + ar[0]] = 1;
  int res = dp[0][10000];
  for (int i = 1; i < n; i++) {
    for (int j = -10000; j <= 10000 - ar[i]; j++)
      dp[i][10000 + j + ar[i]] = dp[i - 1][10000 + j];
    for (int j = -10000 + ar[i]; j <= 10000; j++)
      dp[i][10000 + j - ar[i]] =
          (dp[i][10000 + j - ar[i]] + dp[i - 1][10000 + j]) % (int)(1e9 + 7);
    dp[i][10000 - ar[i]] = (dp[i][10000 - ar[i]] + 1) % (int)(1e9 + 7);
    dp[i][10000 + ar[i]] = (dp[i][10000 + ar[i]] + 1) % (int)(1e9 + 7);
    res = (res + dp[i][10000]) % (int)(1e9 + 7);
  }
  cout << res;
  return 0;
}
