#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) for(int i=0;i<(n);++i) #define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++) int main(int argc, char const *argv[]) { long a,b,c; scanf(" %ld.%ld.%ld", &a, &b, &c); long x=100000*a+101*b+c; scanf(" %ld.%ld.%ld", &a, &b, &c); long y=100000*a+101*b+c; string ans="YES"; if(x