atcoder#ARC108A. [ARC108A] Sum and Product

[ARC108A] Sum and Product

Score : 300300 points

Problem Statement

Given are integers SS and PP. Is there a pair of positive integers (N,M)(N,M) such that N+M=SN + M = S and N×M=PN \times M = P?

Constraints

  • All values in input are integers.
  • 1S,P10121 \leq S,P \leq 10^{12}

Input

Input is given from Standard Input in the following format:

SS PP

Output

If there is a pair of positive integers (N,M)(N,M) such that N+M=SN + M = S and N×M=PN \times M = P, print Yes; otherwise, print No.

3 2
Yes
  • For example, we have N+M=3N+M=3 and N×M=2N \times M =2 for N=1,M=2N=1,M=2.
1000000000000 1
No
  • There is no such pair (N,M)(N,M).