#include <bits/stdc++.h>
using namespace std;
template <typename Tp>
inline void outarr(Tp _begin, Tp _end, const char* _delim = " ") {
  for (Tp current = _begin; current != _end; ++current) {
    std::cout << *current << _delim;
  }
  std::cout << '\n';
}
using ll = long long;
using pii = std::pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr int MOD = static_cast<const int>(1e9 + 7);
constexpr int MAXN = 20005;
int dp[2][MAXN];
int cnt[MAXN];
int sum[MAXN];
int Add(int x, int y) {
  x += y;
  return x < MOD ? x : x - MOD;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < (n); ++i) {
    cin >> arr[i];
  }
  int off = 10000;
  int cur = 0;
  int ans = 0;
  dp[0][off] = 1;
  cnt[off] = 1;
  for (int i = 0; i < (n); ++i) {
    int pre = cur;
    cur ^= 1;
    memset(dp[cur], 0, sizeof(dp[cur]));
    for (int j = -10000; j <= 10000; ++j) {
      if (j - arr[i] >= -10000) {
        dp[cur][j - arr[i] + off] =
            Add(dp[cur][j - arr[i] + off], dp[pre][j + off]);
      }
      if (j + arr[i] <= 10000) {
        dp[cur][j + arr[i] + off] =
            Add(dp[cur][j + arr[i] + off], dp[pre][j + off]);
      }
    }
    ans = Add(ans, dp[cur][off]);
    dp[cur][off] = Add(dp[cur][off], 1);
  }
  cout << ans << "\n";
  return 0;
}
