import java.io.*; import java.util.*; class Main138 { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println(br.readLine().compareTo(br.readLine()) < 0 ? "NO" : "YES"); } }