lines = []; let reader = require('readline').createInterface({ input: process.stdin, output: process.stdout }); reader.on('line', function(line) { lines.push(line); }); reader.on('close', function(line) { let A = lines[0].split(""); let B = lines[1].split(""); if(A.sort().toString() === B.sort().toString()) { return console.log('YES'); } else { return console.log('NO'); } });