#include "iostream" #include "math.h" using namespace std; char letter[2][20]; int num[2][3]; bool flag=false; int box; int main() { cin >> letter[0] >> letter[1]; box = 0; for (int i = 0; letter[0][i] != NULL; i++) { if (letter[0][i] != '.') { num[0][box] *= 10; num[0][box] += letter[0][i] - '0'; } else box++; } box = 0; for (int i = 0; letter[1][i] != NULL; i++) { if (letter[1][i] != '.') { num[1][box] *= 10; num[1][box] += letter[1][i] - '0'; } else box++; } for (int i = 0; i < 3; i++) { if (num[0][i] > num[1][i]) { flag = true; break; } if (num[0][i] < num[1][i])break; } if (num[0][0] == num[1][0] && num[0][1] == num[1][1] && num[2][0] == num[2][1])flag = true; if (flag)cout << "YES\n"; else cout << "NO\n"; return 0; }