#abc218c. [abc218_c]Shapes

[abc218_c]Shapes

Problem Statement

We have two figures SS and TT on a two-dimensional grid with square cells.

SS lies within a grid with NN rows and NN columns, and consists of the cells where Si,jS_{i,j} is #.
TT lies within the same grid with NN rows and NN columns, and consists of the cells where Ti,jT_{i,j} is #.

Determine whether it is possible to exactly match SS and TT by 9090-degree rotations and translations.

Constraints

  • 1leqNleq2001 \\leq N \\leq 200
  • Each of SS and TT consists of # and ..
  • Each of SS and TT contains at least one #.

Input

Input is given from Standard Input in the following format:

NN S1,1S1,2ldotsS1,NS_{1,1}S_{1,2}\\ldots S_{1,N} vdots\\vdots SN,1SN,2ldotsSN,NS_{N,1}S_{N,2}\\ldots S_{N,N} T1,1T1,2ldotsT1,NT_{1,1}T_{1,2}\\ldots T_{1,N} vdots\\vdots TN,1TN,2ldotsTN,NT_{N,1}T_{N,2}\\ldots T_{N,N}

Output

Print Yes if it is possible to exactly match SS and TT by 9090-degree rotations and translations, and No otherwise.


Sample Input 1

5
.....
..#..
.###.
.....
.....
.....
.....
....#
...##
....#

Sample Output 1

Yes

We can match SS to TT by rotating it 9090-degrees counter-clockwise and translating it.


Sample Input 2

5
#####
##..#
#..##
#####
.....
#####
#..##
##..#
#####
.....

Sample Output 2

No

It is impossible to match them by 9090-degree rotations and translations.


Sample Input 3

4
#...
..#.
..#.
....
#...
#...
..#.
....

Sample Output 3

Yes

Each of SS and TT may not be connected.


Sample Input 4

4
#...
.##.
..#.
....
##..
#...
..#.
....

Sample Output 4

No

Note that it is not allowed to rotate or translate just a part of a figure; it is only allowed to rotate or translate a whole figure.