i,f;main(a,b){for(;~scanf("%d.",&f);a=i++%3?a<<7|f:(b=a,f));puts(a>b?"NO":"YES");}