#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t--) {
    long long int n, modd, mev, s = 0;
    cin >> n;
    long long int a[n + 1];
    for (long long int i = 1; i < n + 1; i++) {
      cin >> a[i];
      s += a[i];
    }
    long long int odd[n + 1];
    memset(odd, 0, sizeof(odd));
    odd[0] = 0;
    odd[1] = a[1];
    for (long long int i = 3; i < n + 1; i += 2) {
      odd[i] = odd[i - 2] + a[i];
    }
    long long int ev[n + 1];
    memset(ev, 0, sizeof(ev));
    for (long long int i = 2; i < n + 1; i += 2) {
      ev[i] = ev[i - 2] + a[i];
    }
    if (n % 2) {
      modd = odd[n];
    } else {
      modd = odd[n - 1];
    }
    if (n % 2 == 0) {
      mev = ev[n];
    } else {
      mev = ev[n - 1];
    }
    long long int c = 0;
    for (long long int i = 1; i < n + 1; i++) {
      if (i % 2) {
        if ((ev[i - 1] + modd - odd[i]) * 2 == s - a[i]) {
          c++;
        }
      } else {
        if ((odd[i - 1] + mev - ev[i]) * 2 == s - a[i]) {
          c++;
        }
      }
    }
    cout << c;
  }
}
