Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

HS09POP - Poppy seed

A kingdom far, far away is ruled by a king who has a beautiful daughter. Many knights would like to marry her, but the wise father has to test their abilities first. His court shaman has invented a puzzle, which he puts before each candidate for the princess' hand in marriage. Here it is:

  • There are N bins arranged in a circle,
  • Every bin is filled with some number of poppy seeds,
  • The shaman divided the poppy seeds from the first bin into N equal parts, threw one part into bin number two, and the rest back into the first bin.
  • He then divided the poppy seeds from the second bin into N equal parts, threw one part into bin number three, and the rest back into the second bin.
  • He repeated the procedure for every other bin.
  • Eventually he divided the poppy seeds from the N-th bin into N equal parts, and threw one part into bin number one and the rest back into the N-th bin.
  • After all this it turned out there were exactly A seeds in every bin.

The shaman now asks the knight if this is possible?

One knight is deeply in love with the princess and hence asks you for help with the riddle.

Input

Standard input contains K (1 ≤ K ≤ 10 000) lines, each containing two values N, A (4 ≤ N ≤ 30 000, 200 ≤ A ≤ 10200) separated by spaces. In line K+1 there are two zeros separated by spaces. Do not process this test case.

Output

Write K lines of output. In each line, print the word 'Yes', if the situation described by the shaman possible for the data in the corresponding line of input or the word 'No' in the opposite case.

Example

Input:
5 32
4 17
0 0
Output:
Yes
No

Scoring

By solving this problem you will score 10 points.


Added by:Adam Dzedzej
Date:2009-12-09
Time limit:0.200s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:ADA95 ASM32 BASH BF C CSHARP CPP C99 CLPS LISP sbcl LISP clisp D FORTRAN HASK ICON ICK JAVA JS-RHINO LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCM guile SCM qobi ST TCL TEXT WHITESPACE
Resource:High School Programming League (thanks to Talent Association)

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.