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