#include <bits/stdc++.h>
int ans(int n, unsigned long *a) {
  int ret;
  if (n == 2) {
    ret = a[0] + a[1];
  } else {
    a[n - 3] += a[n - 2];
    a[n - 2] += a[n - 1];
    ret = ans(n - 1, a);
  }
  return ret;
}
int main(void) {
  int loop;
  unsigned long N;
  unsigned long A[(18)];
  int ret;
  scanf("%d", &N);
  if (N <= 2) {
    printf("No\n");
    return 0;
  }
  for (loop = 0; loop < N; loop++) {
    scanf("%ld", &A[N - loop - 1]);
  }
  ret = ans(N, A);
  printf("%ld\n", ret);
  return 0;
}
