import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List listKaseki = getVersion(sc.next()); List listJudge = getVersion(sc.next()); sc.close(); if(JudgeVersion(listKaseki, listJudge)){ System.out.println("YES"); }else{ System.out.println("NO"); } } public static List getVersion(String version){ List list = new ArrayList(); int index = version.indexOf("."); list.add(Integer.parseInt(version.substring(0, index))); String version2 = version.substring(index + 1); list.add(Integer.parseInt(version2.substring(0, index))); list.add(Integer.parseInt(version2.substring(index + 1))); return list; } public static boolean JudgeVersion(List listKaseki, List listJudge){ if(listKaseki.get(0) < listJudge.get(0)){ return false; }else if(listKaseki.get(0) > listJudge.get(0)){ return true; }else{ if(listKaseki.get(1) < listJudge.get(1)){ return false; }else if(listKaseki.get(1) > listJudge.get(1)){ return true; }else{ if(listKaseki.get(1) < listJudge.get(1)){ return false; }else{ return true; } } } } }