#include using namespace std; int main() { int a, b, c, A, B, C; char d; cin >> a >> d >> b >> d >> c; cin >> A >> d >> B >> d >> C; int v = 100 * a + 10 * b + c; int V = 100 * A + 10 * B + C; if (v >= V) cout << "YES" << endl; else cout << "NO" << endl; return 0; }