#include #include #include #include #include using namespace std; typedef long double LD; typedef complex Point; typedef pair Segment; #define X real() #define Y imag() const LD EPS = 1e-9; const LD TPI = 4.0*acosl(0); int cmp1(Point a, Point b) { LD an = norm(a); LD bn = norm(b); if (fabsl(an-bn) > EPS) { if (an max(a.first.X, a.second.X) + EPS ) return false; if ( p.Y > max(a.first.Y, a.second.Y) + EPS ) return false; return true; } LD myarg(Point a) { if (norm(a) < EPS) return 0; else return arg(a); } LD ccw(Point a, Point b) { return a.X * b.Y - a.Y * b.X; } bool overlap(Segment a, Segment b) { if ( fabsl(ccw(a.first-a.second, b.first-a.second)) > EPS ) return false; if ( fabsl(ccw(a.first-a.second, b.second-a.second)) > EPS ) return false; if (inside(a, b.first)) return true; if (inside(a, b.second)) return true; if (inside(b, a.first)) return true; if (inside(b, a.second)) return true; return false; } Point mini(Point a, Point b) { if (a.X < b.X || (a.X == b.X && a.Y < b.Y)) return a; else return b; } Point maxi(Point a, Point b) { if (a.X > b.X || (a.X == b.X && a.Y > b.Y)) return a; else return b; } vector getData() { vector v1; Point cur = 0; while(true) { char buf[4]; Point d; scanf("%s",buf); if (buf[0]=='E') break; if (buf[0]=='Q') exit(0); scanf("%Lf%Lf",&d.X,&d.Y); if (buf[0]=='L') { v1.push_back(Segment(cur,cur+d)); } cur += d; } if (v1.empty()) { vector r; return r; } for(int i=0;i 0) { for(int i=0;i v2; for(int i=0;i v3; for(int i=0;i u,v; u = getData(); v = getData(); if (u.size() != v.size()) return 0; int n = u.size(); // for(int i=0;i p[g] + g) g=i; } for(int i=0;i= n) return true; return false; } int main() { for(;;) if (scase()) { printf("YES\n"); } else { printf("NO\n"); } }