# coding: utf-8 # Your code here! def target_index(l, x, default=999): if x in l: return l.index(x) else: return default list_0 = input().split('.') list_1 = input().split('.') rel = [] for i in range(3): if int(list_0[i]) == int(list_1[i]): rel.append(0) elif int(list_0[i]) > int(list_1[i]): rel.append(-1) elif int(list_0[i]) < int(list_1[i]): rel.append(1) judge_list = [i <= 0 for i in rel] res = 0 # print('rel: {}'.format(rel)) # print('judge_list: {}'.format(judge_list)) if 1 not in rel: # print('passed1') res = 1 elif -1 not in rel: # print('passed2') if all(judge_list): res = 1 else: # print('passed3') if rel.index(-1) < rel.index(1): res = 1 if res == 1: print('YES') else: print('NO')# coding: utf-8 # Your code here! def target_index(l, x, default=999): if x in l: return l.index(x) else: return default list_0 = input().split('.') list_1 = input().split('.') rel = [] for i in range(3): if int(list_0[i]) == int(list_1[i]): rel.append(0) elif int(list_0[i]) > int(list_1[i]): rel.append(-1) elif int(list_0[i]) < int(list_1[i]): rel.append(1) judge_list = [i <= 0 for i in rel] res = 0 # print('rel: {}'.format(rel)) # print('judge_list: {}'.format(judge_list)) if 1 not in rel: # print('passed1') res = 1 elif -1 not in rel: # print('passed2') if all(judge_list): res = 1 else: # print('passed3') if rel.index(-1) < rel.index(1): res = 1 if res == 1: print('YES') else: print('NO')