b=io.read"*n" c=io.read"*n" if(b==c)then print("Yes") else print("No") end