A - Conflict Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MiB

配点 : 100

問題文

N 個の商品があります。高橋君と青木君がどの商品を欲しがっているかを表す長さ N の文字列 T,A が与えられます。T,Ai\ (1\leq i\leq N) 文字目をそれぞれ T_i,A_i とします。

高橋君は T_io のとき i 番目の商品を欲しがっており、T_ix のとき i 番目の商品を欲しがっていません。 同様に、青木君は A_io のとき i 番目の商品を欲しがっており、A_ix のとき i 番目の商品を欲しがっていません。

2 人ともが欲しがっている商品が存在するか判定してください。

制約

  • 1\leq N\leq 100
  • N は整数
  • T,Ao および x からなる長さ N の文字列

入力

入力は以下の形式で標準入力から与えられる。

N
T
A

出力

2 人とも欲しがっている商品が存在するならば Yes を、存在しないならば No を出力せよ。


入力例 1

4
oxoo
xoox

出力例 1

Yes

3 つ目の商品は 2 人ともが欲しがっているため、Yes を出力します。


入力例 2

5
xxxxx
ooooo

出力例 2

No

2 人とも欲しがっている商品は存在しないため、No を出力します。


入力例 3

10
xoooxoxxxo
ooxooooxoo

出力例 3

Yes

Score : 100 points

Problem Statement

There are N items. You are given strings T and A of length N that represent which items Takahashi and Aoki want, respectively. Let T_i and A_i be the i-th (1\leq i\leq N) characters of T and A, respectively.

Takahashi wants the i-th item when T_i is o, and does not want the i-th item when T_i is x. Similarly, Aoki wants the i-th item when A_i is o, and does not want the i-th item when A_i is x.

Determine whether there exists an item that both of them want.

Constraints

  • 1\leq N\leq 100
  • N is an integer.
  • T and A are strings of length N consisting of o and x.

Input

The input is given from Standard Input in the following format:

N
T
A

Output

If there exists an item that both of them want, output Yes; otherwise, output No.


Sample Input 1

4
oxoo
xoox

Sample Output 1

Yes

The third item is wanted by both of them, so output Yes.


Sample Input 2

5
xxxxx
ooooo

Sample Output 2

No

There is no item that both of them want, so output No.


Sample Input 3

10
xoooxoxxxo
ooxooooxoo

Sample Output 3

Yes