def comp_version(p: str, q: str): v1 = {} v2 = {} v1[1] = p.find(".") v2[1] = q.find(".") v1[2] = p.find(".", v1[1]+1) v2[2] = q.find(".", v2[1]+1) v1["answer"]=1000*1000*int(p[0:v1[1]]) v2["answer"]=1000*1000*int(q[0:v2[1]]) v1["answer"]+=1000*int(p[v1[1]+1:v1[2]]) v2["answer"]+=1000*int(q[v2[1]+1:v2[2]]) v1["answer"]+=int(p[v1[2]+1:]) v2["answer"]+=int(q[v2[2]+1:]) result=v1["answer"]>=v2["answer"] return result def main(): p = input() q = input() result = "YES" if comp_version(p, q) else "NO" print(result) if __name__ == "__main__": main()