#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int a[10005],pos[10005];//pos::important 记录位置
int main()
{
int n;char ch;
while(cin>>n&&n)
{
cin>>ch;
memset(pos,0,sizeof(pos));
for(int i=0;i<n;i++)
{
cin>>a[i];
pos[a[i]]=i;
}
int flag=1;
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
int t=a[j]+a[j]-a[i];
if(t>=n||t<0) continue;
if(pos[t]>j) {flag=0;break;}
}
if(flag==0) break;
}
if(flag) cout<<"yes"<<endl;
else cout<<"no"<<endl;
}
return 0;
}
joj 2141
最新推荐文章于 2011-08-25 20:58:57 发布