#include using namespace std; struct Initializer { Initializer() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15); } } initializer; class range {private: struct I{int x;int operator*(){return x;}bool operator!=(I& lhs){return x> c(m, vector(n));for(auto& r:c)for(auto& i:r)cin>>i; #define FOR(i,a,n) for(int i=(a), i##_len=(n); i=(a); --i) #define RFORS(i,a,b) for(int i=(b); i>=(a); --i) #define REP(i,n) for(int i=0, i##_len=(n); i=0; --i) #define RREPS(i,n) for(int i=(n); i>=0; --i) #define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c))) #define PB push_back #define EM emplace #define EB emplace_back #define BI back_inserter #define MP make_pair #define FI first #define SE second #define DUMP( x ) cerr << #x << " = " << ( x ) << endl #define SZ(x) ((int)(x).size()) #define cauto const auto& // 型 typedef long long ll; typedef pair pii; typedef pair pss; typedef pair psi; typedef pair pis; typedef vector vi; typedef vector vd; typedef vector vl; typedef vector vll; typedef vector vs; // Effective std template void remove(vector& c, unsigned int index) { c.erase(c.begin()+index); } template inline istream& operator>>(istream &s, vector &v) { for (T &t : v) s >> t; return s; } template inline ostream& operator<<(ostream &s, const vector &v) { for (const T &t : v) s << t << endl; return s; } template inline bool chmin(T &a, const T &b){if (b < a) {a = b; return true;} return false; } template inline bool chmax(T &a, const T &b){if (a < b) {a = b; return true;} return false; } #define UNIQUE(v) v.erase( unique(ALL(v)), v.end() ); // 定数 constexpr int PI = (2*acos(0.0)); constexpr int EPS = (1e-9); constexpr int MOD = (int)(1e9+7); constexpr int INF = 100000000; vector split(const string &str, char sep) { vector v; stringstream ss(str); string buffer; while( getline(ss, buffer, sep) ) { v.push_back(stoi(buffer)); } return v; } int main(){ string s1, s2; cin >> s1 >> s2; vi v1; v1 = split(s1, '.'); vi v2; v2 = split(s2, '.'); string s = "NO"; if (v1[0] > v2[0]) s = "YES"; else if ((v1[0] == v2[0]) and (v1[1] > v2[1])) s = "YES"; else if ((v1[0] == v2[0]) and (v1[1] == v2[1]) and (v1[2] >= v2[2])) s = "YES"; P(s); return 0; }