#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<stack>
#include<cmath>
#include<algorithm>
#include<functional>
#define inf 99999999
using namespace std;
const int MAX=100000+10;
int a[MAX];
int main(){
    #ifdef SIYU
    freopen("in.txt","r",stdin);
    #endif // SIYU
    int n,i,j,flag=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
        scanf("%d",&a[i]);
    for(i=1;i<=n;i++){
        for(j=1;j<=n;j++){
            int t=i+j;
            if(t>n) t=t-n;
            if(a[t]<j)
                break;
        }
        if(j==n+1){
            cout<<i<<endl;
            printf("YES\n");
            flag=1;
            break;
        }
    }
    if(flag==0)    printf("NO\n");
    return 0;
}
