#include using namespace std; int main(){ int a[3],b[3];char z; cin>>a[0]>>z>>a[1]>>z>>a[2]; cin>>b[0]>>z>>b[1]>>z>>b[2]; for(int i = 0; 3 > i; i++){ if(a[i] < b[i]){ cout << "NO" << endl; return 0; }else if(a[i] > b[i]){ cout << "YES" << endl; return 0; } } cout << "YES" << endl; }