function Main(input) { let data = input.split("\n"); // let data = input.split(" "); let A = data[0]; let B = data[1]; // let = Number(data[0]); // let = Number(data[1]); let arrayA = A.split(''); arrayA = arrayA.sort(); let arrayB = B.split(''); arrayB = arrayB.sort(); if (arrayA === arrayB) { console.log('YES'); } else { console.log('NO'); } } Main(require("fs").readFileSync("/dev/stdin", "utf8"));