You are given two binary strings and of the same length .
You may perform the following operation any number of times:
choose a position (1 \le i \le n) and swap the characters a_i and b_i.
Determine whether it is possible to make both strings nondecreasing after some number of operations.
A binary string is called nondecreasing if it does not contain the character 1 before the character 0. In other words, all 0 characters in such a string are placed before all 1 characters.
The first line contains an integer (1 \le n \le 2 \cdot 10^5) — the length of the strings.
The second line contains a binary string of length .
The third line contains a binary string of length .
Print YES if it is possible to make both strings nondecreasing.
Otherwise, print NO.
Example 1
Example 2
In the first example, it is enough to swap the characters a_2 and b_2. After that, the strings will look like
00011
and
01111,
and both of them are nondecreasing.
In the second example, the first position in both strings contains 1, and the second — 0. The operations cannot change these pairs of characters, so 1 will remain before 0 in both strings. Therefore, it is impossible to make both strings nondecreasing.
Subtask ( points): n \le 1000.
Subtask ( points): No additional constraints.