#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string S, T; cin >> S >> T; for (int i = 0; i < (int)S.size(); i += 2) { if (S[i] < T[i]) { cout << "NO" << '\n'; return 0; } } cout << "YES" << '\n'; return 0; }