#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 7;
const int INF = (1e+9);
int n, k, o[maxn], e[maxn], a[maxn];
int gcd(int x, int y) { return (y == 0) ? (x) : (gcd(y, x % y)); }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  k = 0;
  for (int i = 1; i <= n; i++) k = gcd(k, a[i]);
  if (k > 1) {
    printf("YES\n0\n");
    return 0;
  }
  o[0] = INF, e[0] = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] & 1)
      o[i] = e[i - 1], e[i] = min(o[i - 1] + 1, e[i - 1] + 2);
    else
      o[i] = INF, e[i] = e[i - 1];
  printf("YES\n%d\n", e[n]);
  return 0;
}
