import std.stdio, std.string, std.conv, std.algorithm, std.numeric; import std.range, std.array, std.math, std.typecons, std.container, core.bitop; void main() { ["NO", "YES"][iota(2).map!(i => readln.chomp.to!(dchar[]).sort()).array.uniq.count == 1].writeln; }