#include #define FOR(i,a,b) for(int i = (a); i < (b); ++i) #define REP(i,n) FOR(i,0,n) #define sz(n) (int)(n).size() using namespace std; typedef long long ll; typedef vector VI; int main() { string s1, s2; int t1[3]; char t; cin >> t1[0] >> t >> t1[1] >> t >> t1[2]; REP(i, 3) s1 += t1[i]; cin >> t1[0] >> t >> t1[1] >> t >> t1[2]; REP(i, 3) s2 += t1[i]; if (s1 >= s2) { cout << "YES" << endl; return 0; } cout << "NO" << endl; return 0; }