A congruent number is an integer that is the area of some right triangle whose sides all have rational length. In this problem you only look at the two legs of the right triangle, not the hypotenuse.
A rational number is a fraction p/q where the numerator p and the denominator q are both integers. If q=1, then p/1 is an integer, so every integer is a rational number.
You are given the rational lengths of the two legs of a right triangle. Determine whether the area of that triangle is a congruent number. In this problem the hypotenuse does not have to be rational.
Input
The input consists of a single test case. Your program may be run several times on different inputs.
The first line contains four integers p1, q1, p2, q2 (1≤p1,q1,p2,q2≤100000). The numbers p1/q1 and p2/q2 are the lengths of the two legs of the right triangle.
Output
Print 1 on a single line if the area of the triangle is an integer, and 0 otherwise. A rational area is not enough; it has to be an integer.