package b2015_5_31; import java.util.Scanner; public class KasekiVer { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s1 = sc.nextLine(); String s2 = sc.nextLine(); String a = ""; String b =""; int t1 = 0; int t2 = 0; int t3 = 0; int t4 = 0; int n1 = 1; int n2 = 1; int n3 = 0; t1 = Integer.parseInt(Nuki(s1, a, n1)); t2 = Integer.parseInt(Nuki(s2, b, n2)); n1+=Nuki(s1, a, n1).length(); n2+=Nuki(s2, b, n2).length(); for(int i = 0; i < 4; i++){ if(n3==3){ System.out.println("YES"); break; }else if(t1 > t2){ System.out.println("YES"); break; }else if(t1 < t2){ System.out.println("NO"); break; }else if(t1 == t2){ a = ""; b =""; t1 = 0; t2 = 0; t1 = Integer.parseInt(Nuki(s1, a, n1)); t2 = Integer.parseInt(Nuki(s2, b, n2)); n1+=Nuki(s1, a, n1).length(); n2+=Nuki(s2, b, n2).length(); n3++; } } } public static String Nuki(String s, String ab, int n){ while(!(s.substring(n-1, n)).equals(".")){ ab+=s.substring(n-1, n); n++; } return ab; } }