#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> v;
vector<pair<long long, long long>> Left;
vector<pair<long long, long long>> Right;
void print_vector(const vector<pair<long long, long long>> &v) {
  for (auto el : v) {
    cout << el.first << " " << el.second << endl;
  }
}
void load() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    v.push_back(a);
  }
}
void init_sums(const vector<int> &v, vector<pair<long long, long long>> *sums) {
  long long sum_even = 0;
  long long sum_odd = 0;
  (*sums).push_back(make_pair(sum_even, sum_odd));
  for (int i = 1; i < v.size(); ++i) {
    if (i % 2 == 0) {
      sum_even = (*sums)[i - 1].first + v[i - 1];
      sum_odd = (*sums)[i - 1].second;
    } else {
      sum_even = (*sums)[i - 1].first;
      sum_odd = (*sums)[i - 1].second + v[i - 1];
    }
    (*sums).push_back(make_pair(sum_even, sum_odd));
  }
}
void init() {
  vector<int> v_cpy(v);
  init_sums(v_cpy, &Left);
  reverse(v_cpy.begin(), v_cpy.end());
  init_sums(v_cpy, &Right);
  reverse(Right.begin(), Right.end());
}
bool is_good(int candy_idx) {
  long long sum_even, sum_odd;
  if ((n - 1) % 2 == 0) {
    sum_even = Left[candy_idx].first + Right[candy_idx].second;
    sum_odd = Left[candy_idx].second + Right[candy_idx].first;
  } else {
    sum_even = Left[candy_idx].first + Right[candy_idx].first;
    sum_odd = Left[candy_idx].second + Right[candy_idx].second;
  }
  return sum_even == sum_odd;
}
void solve() {
  init();
  int sol = 0;
  for (int i = 0; i < v.size(); ++i) {
    if (is_good(i)) {
      sol++;
    }
  }
  cout << sol << endl;
}
int main() {
  load();
  solve();
  return 0;
}
