#!/usr/bin/python c0, c1 = map(lambda e: map(int, e.split('.')), (raw_input(), raw_input())) print 'YES' if c0 >= c1 else 'NO'