#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*100*100 + b*100 + c; ll tgt = d*100*100 + e*100 + f; cout << (fos >= tgt ? "YES" : "NO") << endl; return 0; }