print((function (f) return f()==f() and "YES" or "NO" end)((function (M) local C,CB = M.C,M.cast("int(*)(const char *,const char *)",function (a,b) return a[0]-b[0] end) M.cdef 'void qsort(void *,size_t,size_t,int(*)(const void *,const void *));' return function () local s=io.stdin:read("*l") local c=M.new("char[?]",#s+1,s) C.qsort(c,#s,1,CB) return M.string(c) end end)(require'ffi')))