#include #include #define CMAX 20 typedef struct { int x; int y; } PT; double dist(PT a, PT b) { return( sqrt( (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) ) ); } int main(void) { int i,n; PT h,d,c[CMAX]; int sumi[CMAX]; double min,limit,nowdist; int last,count,next; while(1){ scanf("%d %d %d %d %d",&n,&h.x,&h.y,&d.x,&d.y); if(n+h.x+h.y+d.x+h.y==0) break; // printf("\n%d (%d,%d) (%d,%d)\n",n,h.x,h.y,d.x,d.y); for(i=0; i=limit){ // リミットの距離を超えてしまったら全部集められない break; } sumi[next]=1; h=c[next]; } if(count==n){ puts("YES"); }else{ puts("NO"); } } return(0); }