# include <bits/stdc++.h>
using namespace std;
# define fi cin
# define fo cout
int main(void)
{
int n;
fi>>n;
int g = 0,v,cnt = 0,ans = 0;
while (n --)
{
int v;
fi>>v;
g = __gcd(g,v);
if (v & 1) ++cnt;
else ans += (cnt / 2) + 2 * (cnt & 1),cnt = 0;
}
ans += (cnt / 2) + 2 * (cnt & 1);
fo << "YES\n";
if (g == 1)
fo << ans << '\n';
else
fo << "0\n";
cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
return 0;
}
IyBpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojIGRlZmluZSBmaSBjaW4KIyBkZWZpbmUgZm8gY291dAppbnQgbWFpbih2b2lkKQp7CiAgICBpbnQgbjsKICAgIGZpPj5uOwogICAgaW50IGcgPSAwLHYsY250ID0gMCxhbnMgPSAwOwogICAgd2hpbGUgKG4gLS0pCiAgICB7CiAgICAgICAgaW50IHY7CiAgICAgICAgZmk+PnY7CiAgICAgICAgZyA9IF9fZ2NkKGcsdik7CiAgICAgICAgaWYgKHYgJiAxKSArK2NudDsKICAgICAgICBlbHNlIGFucyArPSAoY250IC8gMikgKyAyICogKGNudCAmIDEpLGNudCA9IDA7CiAgICB9CiAgICBhbnMgKz0gKGNudCAvIDIpICsgMiAqIChjbnQgJiAxKTsKICAgIGZvIDw8ICJZRVNcbiI7CiAgICBpZiAoZyA9PSAxKQogICAgICAgIGZvIDw8IGFucyA8PCAnXG4nOwogICAgZWxzZQogICAgICAgIGZvIDw8ICIwXG4iOwogICAgY2VyciA8PCAiVGltZSBlbGFwc2VkIDoiIDw8IGNsb2NrKCkgKiAxMDAwLjAgLyBDTE9DS1NfUEVSX1NFQyA8PCAiIG1zIiA8PCAnXG4nOwogICAgcmV0dXJuIDA7Cn0K