#include<stdio.h>
int main()
{
int n;
scanf ("%d",&n);//定义shabi数组
int my[999]={0};
int i;
for (i=0;i<n;i++){
scanf ("%d",&my[i]);//初始shabi
}
int x=1;
for (i=1;i<n-1;i++){ //判断条件
if (((my[i])<(my[i+1]))&&((my[i])<(my[i-1]))||((my[i])>(my[i+1])&&(my[i])>(my[i-1]))){
printf("%d ",i); //输出位置
x=0;
}
}
if(x==1){
printf("NO");
}
return 0;
}