import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.stream.Stream; public class No00000138_Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] arr1 = Stream.of(br.readLine().split("\\.")).mapToInt(Integer::parseInt).toArray(); int[] arr2 = Stream.of(br.readLine().split("\\.")).mapToInt(Integer::parseInt).toArray(); System.out.println(arr1[0] < arr2[0] || arr1[1] < arr2[1] || arr1[2] < arr2[2] ? "NO" : "YES"); } }