#include using namespace std; int main() { int A[2], B[2], C[2]; for (int i = 0; i < 2; i++) { cin >> A[i] >> B[i] >> C[i]; } bool Flag = false; if ((A[0] > A[1]) || (A[0] == A[1] && B[0] > B[1]) || (A[0] == A[1] && B[0] == B[1] && C[0] > C[1]))Flag = true; if (Flag == true)cout << "YES" << endl; else if (Flag == false)cout << "NO" << endl; return 0; }