#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 1000005;
int t[maxn];
int n, sum;
int main()
{
scanf("%d", &n);
for(int i = 1; i <= n; i++)
{
scanf("%d", &t[i]);
sum += t[i];
}
if( sum != 0 )
{
printf("YES\n1\n1 %d", n);
return 0;
}
int it = 1;
while( t[it] == 0 )
{
it ++;
}
if( it > n )
{
printf("NO");
return 0;
}
if( it == n )
{
printf("YES\n1\n1 %d", n);
return 0;
}
/*int poz = it + 1;
while( t[poz] == 0 )
{
poz ++;
}
if( poz > n )
{
printf()
}*/
printf("YES\n2\n1 %d\n%d %d", it, it + 1, n);
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPHZlY3Rvcj4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgbWF4biA9IDEwMDAwMDU7CgppbnQgdFttYXhuXTsKCmludCBuLCBzdW07CgppbnQgbWFpbigpCnsKICAgIHNjYW5mKCIlZCIsICZuKTsKCiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IG47IGkrKykKICAgIHsKICAgICAgICBzY2FuZigiJWQiLCAmdFtpXSk7CiAgICAgICAgc3VtICs9IHRbaV07CiAgICB9CgogICAgaWYoIHN1bSAhPSAwICkKICAgIHsKICAgICAgICBwcmludGYoIllFU1xuMVxuMSAlZCIsIG4pOwogICAgICAgIHJldHVybiAwOwogICAgfQoKICAgIGludCBpdCA9IDE7CiAgICB3aGlsZSggdFtpdF0gPT0gMCApCiAgICB7CiAgICAgICAgaXQgKys7CiAgICB9CgogICAgaWYoIGl0ID4gbiApCiAgICB7CiAgICAgICAgcHJpbnRmKCJOTyIpOwogICAgICAgIHJldHVybiAwOwogICAgfQoKICAgIGlmKCBpdCA9PSBuICkKICAgIHsKICAgICAgICBwcmludGYoIllFU1xuMVxuMSAlZCIsIG4pOwogICAgICAgIHJldHVybiAwOwogICAgfQoKICAgIC8qaW50IHBveiA9IGl0ICsgMTsKICAgIHdoaWxlKCB0W3Bvel0gPT0gMCApCiAgICB7CiAgICAgICAgcG96ICsrOwogICAgfQoKICAgIGlmKCBwb3ogPiBuICkKICAgIHsKICAgICAgICBwcmludGYoKQogICAgfSovCgogICAgcHJpbnRmKCJZRVNcbjJcbjEgJWRcbiVkICVkIiwgaXQsIGl0ICsgMSwgbik7Cn0=