Vertical Exchange#13058

Vertical Exchange

1 second
256 megabytes
Medium

You are given two binary strings and of the same length .

You may perform the following operation any number of times:

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.

Input

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 .

Output

Print YES if it is possible to make both strings nondecreasing.

Otherwise, print NO.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

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.

Scoring

  1. Subtask ( points): n \le 1000.

  2. Subtask ( points): No additional constraints.