#include using namespace std; int main() { int a0, b0, c0, a1, b1, c1; char Deli; cin >> a0 >> Deli >> b0 >> Deli >> c0; cin >> a1 >> Deli >> b1 >> Deli >> c1; int x0 = a0 * 1000000 + b0 * 1000 + c0; int x1 = a1 * 1000000 + b1 * 1000 + c1; if (x1 <= x0) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }