from distutils.version import StrictVersion fossil_version = input() target_version = input() if StrictVersion(fossil_version) < StrictVersion(fossil_version): print('YES') else: print('NO')