import java.util.Scanner; public class No138 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // ドットで区切って文字列配列に格納 String[] kasekiVerString = sc.next().split("\\."); String[] hanteiVerString = sc.next().split("\\."); int[] kasekiVer = new int[3]; int[] hanteiVer = new int[3]; sc.close(); // 文字列からIntに変換して配列に格納 for(int i = 0; i < 3; i++){ kasekiVer[i] = Integer.valueOf(kasekiVerString[i]); hanteiVer[i] = Integer.valueOf(hanteiVerString[i]); } String kaseki = "YES"; if(kasekiVer[0] < hanteiVer[0]){ kaseki = "NO"; }else if(kasekiVer[0] == hanteiVer[0]){ if(kasekiVer[1] < kasekiVer[1]){ kaseki = "NO"; }else if(kasekiVer[1] == hanteiVer[1]){ if(kasekiVer[2] < kasekiVer[2]){ kaseki = "NO"; } } } System.out.println(kaseki); } }