17 lines
No EOL
315 B
Python
17 lines
No EOL
315 B
Python
columns = int(input(""))
|
|
|
|
murders_acceptable = 2
|
|
|
|
row1 = input("")
|
|
row2 = input("")
|
|
|
|
for cell1, cell2 in zip(row1, row2):
|
|
if cell1 == "S" and cell2 == "S":
|
|
murders_acceptable -= 1
|
|
if murders_acceptable == -1:
|
|
break
|
|
|
|
if murders_acceptable == -1:
|
|
print("NO")
|
|
else:
|
|
print("YES") |