i,f;main(a,b){scanf("%d.",&f);f=i++%3?main(a*99+f,b):i-7?main(f,a):!puts(a>b?"NO":"YES");}