#include using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++) #define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++) #define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--) #define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--) #define all(x) (x).begin(), (x).end() #define sz(x) ((ll)(x).size()) #define len(x) ((ll)(x).length()) int main() { cin.tie(0); ios::sync_with_stdio(false); // ifstream in("input.txt"); // cin.rdbuf(in.rdbuf()); string bs, cs; cin >> bs >> cs; ll ba, bb, bc, bcnt = 0; rep(i, len(bs)) { if (bs[i] == '.') { bcnt++; } else { if (bcnt == 0) ba = ba * 10 + (bs[i] - '0'); else if (bcnt == 1) bb = bb * 10 + (bs[i] - '0'); else bc = bc * 10 + (bs[i] - '0'); } } ll ca, cb, cc, ccnt = 0; rep(i, len(cs)) { if (cs[i] == '.') { ccnt++; } else { if (ccnt == 0) ca = ca * 10 + (cs[i] - '0'); else if (ccnt == 1) cb = cb * 10 + (cs[i] - '0'); else cc = cc * 10 + (cs[i] - '0'); } } if (ba > ca) { cout << "YES" << endl; return 0; } if (ba < ca) { cout << "NO" << endl; return 0; } if (bb > cb) { cout << "YES" << endl; return 0; } if (bb < cb) { cout << "NO" << endl; return 0; } if (bc >= cc) { cout << "YES" << endl; return 0; } else { cout << "NO" << endl; } return 0; }