#ifdef HAVE_CONFIG_H
#include
#endif
#include
#include
int main(int argc, char *argv[])
{
int num,i,j;
int k ;
int l[1002];
int s[1003];
printf("please input the total num of your coaches\n");
while(scanf("%d",&num), num != 0)
{
k = 0;
for(i = 0; i < num; i++)
scanf("%d", &l[i]);
s[0] = 0;
j = 0;
for(i = 0; i < num; i++)
{
while(1)
{
if(l[i] == s[j])
{
j--;
break;
}
else
{
j++;
k++;
s[j] = k;
if(k > num)
break;
}
}
if(k > num)
break;
}
if(j == 0)
printf("Yes\n");
else
printf("No\n");
}
return 0;
}
阅读(2469) | 评论(0) | 转发(0) |