x = tuple(map(int, input().split('.'))) y = tuple(map(int, input().split('.'))) print(['NO', 'YES'][x >= y])