Mike has a sequence *A* = [*a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>] of length *n*. He considers the sequence *B* = [*b*<sub class="lower-index">1</sub>, *b*<sub class="lower-index">2</sub>, ..., *b*<sub class="lower-index">*n*</sub>] beautiful if the *gcd* of all its elements is bigger than 1, i.e. <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/1829934399ec1245c6050a62cf6e36810163b03b.png" style="max-width: 100.0%;max-height: 100.0%;"/>. 

Mike wants to change his sequence in order to make it beautiful. In one move he can choose an index *i* (1 ≤ *i* &lt; *n*), delete numbers *a*<sub class="lower-index">*i*</sub>, *a*<sub class="lower-index">*i* + 1</sub> and put numbers *a*<sub class="lower-index">*i*</sub> - *a*<sub class="lower-index">*i* + 1</sub>, *a*<sub class="lower-index">*i*</sub> + *a*<sub class="lower-index">*i* + 1</sub> in their place instead, in this order. He wants perform as few operations as possible. Find the minimal number of operations to make sequence *A* beautiful if it's possible, or tell him that it is impossible to do so.

<img align="middle" class="tex-formula" src="https://espresso.codeforces.com/69b4319fc56f0d760506d7f84e7647ff65f6bdc5.png" style="max-width: 100.0%;max-height: 100.0%;"/> is the biggest non-negative number *d* such that *d* divides *b*<sub class="lower-index">*i*</sub> for every *i* (1 ≤ *i* ≤ *n*).
The first line contains a single integer *n* (2 ≤ *n* ≤ 100 000) — length of sequence *A*.

The second line contains *n* space-separated integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — elements of sequence *A*.
In the first example you can simply make one move to obtain sequence [0, 2] with <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/6ddb490b8e898198d30c56c6edce2cf15e6f998a.png" style="max-width: 100.0%;max-height: 100.0%;"/>.

In the second example the *gcd* of the sequence is already greater than 1.
2
1 1
YES
1
3
6 2 4
YES
0
2
1 3
YES
1
9
57 30 28 81 88 32 3 42 25
YES
8
2
8 77
YES
2
4
92 46 3 21
YES
1
2
78 26
YES
0
2
3 6
YES
0
2
3 9
YES
0
2
3 3
YES
0
3
3 6 3
YES
0
3
3 9 15
YES
0
3
3 6 9
YES
0
3
3 3 3
YES
0
3
3 9 18
YES
0
5
1 2 1 2 1
YES
6
2
9 6
YES
0
4
3 6 9 12
YES
0
3
3 9 27
YES
0
3
3 9 12
YES
0
5
6 6 9 15 21
YES
0
2
5 15
YES
0
4
2 3 9 13
YES
3
4
3 3 3 3
YES
0
5
3 9 9 9 27
YES
0
2
9 9
YES
0
3
3 9 9
YES
0
3
7 14 21
YES
0
3
3 12 4
YES
2
5
3 3 3 3 3
YES
0
#----------------------------IMPORTING LIBRARIES----------------------------#
import math
import itertools
import heapq
from math import floor, ceil
from collections import deque
import sys
from collections import Counter
#----------------------------LAMBDAS AND DEFAULT----------------------------#
I = lambda:list(map(int,input().split()))
MAP = lambda:map(int, input().split())
input = sys.stdin.readline
sys.setrecursionlimit(10000) 
MOD = 10**9 + 7
#-----------------------------STANDARD FUNCTIONS----------------------------#
def lcm(a, b):
    return abs(a*b) // math.gcd(a, b)

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

def isSubsequence(s, t):
    for i in range (0, len(s)):    
        try:
            index = t.index(s[i])
        except ValueError: 
            return False
        t = t[index+1:]
    return True

def bisect_right(a, x):
        lo, hi = 0, len(a)
        while lo < hi:
            mid = lo + (hi - lo) // 2
            if a[mid] > x: hi = mid
            else: lo = mid + 1
        return lo
    
def bisect_left(a, x):
    lo, hi = 0, len(a)
    while lo < hi:
        mid = lo + (hi - lo) // 2
        if a[mid] < x: lo = mid + 1
        else: hi = mid
    return lo

def binary_search(nums, target):
    left, right = 0, len(nums) - 1
    while left <= right:
        pivot = left + (right - left) // 2
        if nums[pivot] == target:
            return pivot
        if target < nums[pivot]:
            right = pivot - 1
        else:
            left = pivot + 1
    return -1

#------------------------------HELPER FUNCTION------------------------------#
def prefixSum(arr):
    dp = [arr[0]]
    arrLen = len(arr)
    for i in range(1, arrLen): dp.append(dp[-1] + arr[i])
    return dp

def suffixSum(arr):
    arrLen = len(arr)
    dp = [0] * arrLen
    dp[-1] = arr[-1]
    for i in range(N-2, -1, -1): dp[i] = dp[i+1] + arr[i]
    return dp

def fun():
    return 


    
# sys.stdout.write(str(X) + "\n") 
def solve():
    ans = 0 
    N = int(input())
    arr = I()
    #0 even 1 odd
    last = arr[1]%2
    print("YES")
    for i in range(N-1):
        x, y = arr[i], arr[i+1]
        if x%2 == 1 and y%2 == 1:
            arr[i] += 1
            arr[i+1] += 1
            ans += 1
    for i in range(N-1):
        x, y =  arr[i], arr[i+1]
        if x%2 == 1 and y%2 == 0:
            arr[i] += 1
            ans += 2
        elif x%2 == 0 and y%2 == 1:
            arr[i+1] = 1
            ans += 2
    print(ans)
            

#---------------------------------DRIVER CODE--------------------------------#
TC = 1
#TC = int(input())
for testcases in range(TC):
    solve()