def f(): return map(int, input().split(('.'))) A, B, C = f() a, b, c = f() print(['NO', 'YES'][100000*A+1000*B+C >= 100000*a+1000*b+c])