from distutils.version import StrictVersion fossil_version = input() target_version = input() if fossil_version is not target_version and StrictVersion(fossil_version) > StrictVersion(target_version): print('YES') else: print('NO')