#include #include #include using namespace std; using ll = long long; //138 int main() { int a[2], b[2], c[2]; scanf("%d.%d.%d", a, b, c); scanf("%d.%d.%d", a + 1, b + 1, c + 1); if (a[1] != a[0]) printf("%s\n", a[1] < a[0] ? "YES" : "NO"); else if (b[1] != b[0]) printf("%s\n", b[1] < b[0] ? "YES" : "NO"); else printf("%s\n", c[1] <= c[0] ? "YES" : "NO"); }