Equivalence
Schoolboy Beka discovered that the same mathematical relation can be expressed in various forms. For instance, "x>=25" can also be written as "x-25>=0", "25<=x", or even "2*x-3*y-12>=x-y*3+13". Intrigued by this, Beka started verifying the equivalence of different relations found in a comprehensive mathematics problem book. Two relations are considered equivalent if, for any set of variable values, both relations are either true or false simultaneously (i.e., their truth values are always the same).
Eager to verify the equivalence of all the relations in the book, Beka soon realized he needed a program to expedite the process. Since he cannot program, he seeks your assistance.
Your task is to write a program that, given two relations, determines whether they are equivalent, outputting either YES or NO. Each relation is provided as a string. The comparison operators can be any of the following: "<", "<=", ">", ">=", "=", "<>". The operands in the expressions forming the left and right sides of the relations can only be two-character variables 0, 1, ..., 9, or decimal numbers with up to two digits (possibly with a leading zero). The expressions can include the following operators: "-", "|", "*".
Input
The input file consists of two lines that adhere to the specified constraints. Each line contains one relation that satisfies the following conditions.
The length of each line is between 3 and 1000 characters. In the sequence of operation signs for both the left and right parts, the multiplication sign cannot appear consecutively. The lines do not contain spaces. In the expressions, a variable can only be multiplied by a number, and similarly, a number can only be multiplied by a variable.
The tests ensure that the relations are correctly formatted. Specifically, each relation contains exactly one comparison operator, and both the left and right parts are provided in accordance with the conditions.
Output
The output file should contain a single line. This line should start with YES if the relations are equivalent, or NO if they are not.