1 #include<iostream>
2 #include<cstdio>
3
4 using namespace std;
5
6 int n, a[100005], ans;
7
8 int gcd(int a, int b){
9 if(b == 0)
10 return a;
11 return gcd(b, a % b);
12 }
13
14 int main(){
15 scanf("%d", &n);
16 for(int i = 1; i <= n; i++)
17 scanf("%d", &a[i]);
18 if(n == 1){
19 printf("YES
0
");
20 return 0;
21 }//特判
22 int now = gcd(a[1], a[2]);
23 for(int i = 3; i <= n; i++)
24 now = gcd(a[i], now);//gcd
25 if(now != 1){
26 printf("YES
0
");
27 return 0;
28 }//特判
29 else{
30 a[n + 1] = 0;
31 for(int i = 1; i <= n; i++){
32 if(a[i] % 2 == 1 && a[i + 1] % 2 == 1){
33 ans++;
34 a[i + 1] = 0;//已经操作成偶数,所以赋值成任何一个偶数都可
35 }
36 else if(a[i] % 2 == 1 && a[i + 1] % 2 == 0)//一奇一偶
37 ans += 2;
38 }
39 printf("YES
%d
", ans);
40 }
41 return 0;
42 }