#include using namespace std; typedef unsigned long long ul; typedef signed long long ll; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; int a, b, c, d, e, f; char buf; cin >> a >> buf >> b >> buf >> c >> d >> buf >> e >> buf >> f; ll fos = a*101*101 + b*101 + c; ll tgt = d*101*101 + e*101 + f; cout << (fos >= tgt ? "YES" : "NO") << endl; return 0; }