#include using namespace std; const long long INF = 1LL << 60; #define MOD 1000000007; typedef long long ll; #define writeln(n) cout< P; typedef pair Psi; vector a(3); vector b(3); int main() { ; scanf("%d.%d.%d",&a[0],&a[1],&a[2]); scanf("%d.%d.%d",&b[0],&b[1],&b[2]); if(b<=a){ writeln("YES"); }else { writeln("NO"); } }