Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then value 800 ms will be displayed and used to determine the verdict.

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

C. XOR and OR

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputThe Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.

A Bitlandish string is a string made only of characters "0" and "1".

BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish string *a*, and applies several (possibly zero) operations to it. In one operation the mayor may take any two adjacent characters of a string, define one of them as *x* and the other one as *y*. Then he calculates two values *p* and *q*: *p* = *x* *xor* *y*, *q* = *x* *or* *y*. Then he replaces one of the two taken characters by *p* and the other one by *q*.

The *xor* operation means the bitwise excluding OR operation. The *or* operation is the bitwise OR operation.

So for example one operation can transform string 11 to string 10 or to string 01. String 1 cannot be transformed into any other string.

You've got two Bitlandish strings *a* and *b*. Your task is to check if it is possible for BitHaval to transform string *a* to string *b* in several (possibly zero) described operations.

Input

The first line contains Bitlandish string *a*, the second line contains Bitlandish string *b*. The strings can have different lengths.

It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 10^{6}.

Output

Print "YES" if *a* can be transformed into *b*, otherwise print "NO". Please do not print the quotes.

Examples

Input

11

10

Output

YES

Input

1

01

Output

NO

Input

000

101

Output

NO

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/19/2018 04:06:58 (d2).

Desktop version, switch to mobile version.

User lists

Name |
---|