A. Two Regular Polygons

problem_index: A

time_limit: 1 second

memory_limit: 256 megabytes

note:
![image](images/cf_1312_A/2.png) The first test case of the example
It can be shown that the answer for the second test case of the example is "NO".

solutions: ["t = int(input())\nfor i in range(t):\n\t(a, b) = list(map(int, input().rstrip().split()))\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input(''))\nfor i in range(t):\n\ts = input('')\n\tL = s.split(' ')\n\t(n, m) = (int(L[0]), int(L[1]))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from math import *\nfrom collections import *\nfrom operator import itemgetter\nimport bisect\nii = lambda : int(input())\niia = lambda : list(map(int, input().split()))\nisa = lambda : list(input().split())\nI = lambda : list(map(int, input().split()))\nchrIdx = lambda x: ord(x) - 96\nidxChr = lambda x: chr(96 + x)\nt = ii()\nfor i in range(t):\n\t(n, m) = iia()\n\tn = max(n, m)\n\tm = min(n, m)\n\tif (n - m) % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from math import log, ceil\nfrom collections import defaultdict\nfrom math import *\nfrom sys import stdin, stdout\nimport itertools\nimport os\nimport sys\nimport threading\nfrom collections import deque, Counter, OrderedDict, defaultdict\nfrom heapq import *\nfrom fractions import Fraction\nmod = int(pow(10, 9) + 7)\n\ndef ii():\n\treturn int(input())\n\ndef si():\n\treturn str(input())\n\ndef mi():\n\treturn map(int, input().split())\n\ndef li():\n\treturn list(mi())\n\ndef fii():\n\treturn int(stdin.readline())\n\ndef fsi():\n\treturn str(stdin.readline())\n\ndef fmi():\n\treturn map(int, stdin.readline().split())\n\ndef fli():\n\treturn list(fmi())\nabd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}\n\ndef getKey(item):\n\treturn item[0]\n\ndef sort2(l):\n\treturn sorted(l, key=getKey)\n\ndef d2(n, m, num):\n\treturn [[num for x in range(m)] for y in range(n)]\n\ndef isPowerOfTwo(x):\n\treturn x and (not x & x - 1)\n\ndef decimalToBinary(n):\n\treturn bin(n).replace('0b', '')\n\ndef ntl(n):\n\treturn [int(i) for i in str(n)]\n\ndef powerMod(x, y, p):\n\tres = 1\n\tx %= p\n\twhile y > 0:\n\t\tif y & 1:\n\t\t\tres = res * x % p\n\t\ty = y >> 1\n\t\tx = x * x % p\n\treturn res\ngraph = defaultdict(list)\nvisited = [0] * 1000000\ncol = [-1] * 1000000\n\ndef bfs(d, v):\n\tq = []\n\tq.append(v)\n\tvisited[v] = 1\n\twhile len(q) != 0:\n\t\tx = q[0]\n\t\tq.pop(0)\n\t\tfor i in d[x]:\n\t\t\tif visited[i] != 1:\n\t\t\t\tvisited[i] = 1\n\t\t\t\tq.append(i)\n\t\tprint(x)\n\ndef make_graph(e):\n\td = {}\n\tfor i in range(e):\n\t\t(x, y) = mi()\n\t\tif x not in d:\n\t\t\td[x] = [y]\n\t\telse:\n\t\t\td[x].append(y)\n\t\tif y not in d:\n\t\t\td[y] = [x]\n\t\telse:\n\t\t\td[y].append(x)\n\treturn d\n\ndef gr2(n):\n\td = defaultdict(list)\n\tfor i in range(n):\n\t\t(x, y) = mi()\n\t\td[x].append(y)\n\treturn d\n\ndef connected_components(graph):\n\tseen = set()\n\n\tdef dfs(v):\n\t\tvs = set([v])\n\t\tcomponent = []\n\t\twhile vs:\n\t\t\tv = vs.pop()\n\t\t\tseen.add(v)\n\t\t\tvs |= set(graph[v]) - seen\n\t\t\tcomponent.append(v)\n\t\treturn component\n\tans = []\n\tfor v in graph:\n\t\tif v not in seen:\n\t\t\td = dfs(v)\n\t\t\tans.append(d)\n\treturn ans\n\ndef primeFactors(n):\n\ts = set()\n\twhile n % 2 == 0:\n\t\ts.add(2)\n\t\tn = n // 2\n\tfor i in range(3, int(sqrt(n)) + 1, 2):\n\t\twhile n % i == 0:\n\t\t\ts.add(i)\n\t\t\tn = n // i\n\tif n > 2:\n\t\ts.add(n)\n\treturn s\n\ndef find_all(a_str, sub):\n\tstart = 0\n\twhile True:\n\t\tstart = a_str.find(sub, start)\n\t\tif start == -1:\n\t\t\treturn\n\t\tyield start\n\t\tstart += len(sub)\n\ndef SieveOfEratosthenes(n, isPrime):\n\tisPrime[0] = isPrime[1] = False\n\tfor i in range(2, n):\n\t\tisPrime[i] = True\n\tp = 2\n\twhile p * p <= n:\n\t\tif isPrime[p] == True:\n\t\t\ti = p * p\n\t\t\twhile i <= n:\n\t\t\t\tisPrime[i] = False\n\t\t\t\ti += p\n\t\tp += 1\n\treturn isPrime\n\ndef dijkstra(edges, f, t):\n\tg = defaultdict(list)\n\tfor (l, r, c) in edges:\n\t\tg[l].append((c, r))\n\t(q, seen, mins) = ([(0, f, ())], set(), {f: 0})\n\twhile q:\n\t\t(cost, v1, path) = heappop(q)\n\t\tif v1 not in seen:\n\t\t\tseen.add(v1)\n\t\t\tpath = (v1, path)\n\t\t\tif v1 == t:\n\t\t\t\treturn (cost, path)\n\t\t\tfor (c, v2) in g.get(v1, ()):\n\t\t\t\tif v2 in seen:\n\t\t\t\t\tcontinue\n\t\t\t\tprev = mins.get(v2, None)\n\t\t\t\tnext = cost + c\n\t\t\t\tif prev is None or next < prev:\n\t\t\t\t\tmins[v2] = next\n\t\t\t\t\theappush(q, (next, v2, path))\n\treturn float('inf')\n\ndef binsearch(a, l, r, x):\n\twhile l <= r:\n\t\tmid = l + (r - 1) // 2\n\t\tif a[mid]:\n\t\t\treturn mid\n\t\telif a[mid] > x:\n\t\t\tl = mid - 1\n\t\telse:\n\t\t\tr = mid + 1\n\treturn -1\n\ndef dfs(d, v):\n\tq = []\n\tq.insert(0, v)\n\tvisited[v] = 1\n\twhile len(q) != 0:\n\t\tx = q[0]\n\t\tq.pop(0)\n\t\tfor i in d[x]:\n\t\t\tif visited[i] != 1:\n\t\t\t\tvisited[i] = 1\n\t\t\t\tq.insert(0, i)\n\t\tprint(x)\nfor _ in range(ii()):\n\t(a, b) = mi()\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor z in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def func():\n\t(m, n) = map(int, input().split())\n\tif m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nT = int(input())\nfor _ in range(T):\n\tfunc()\n", "for i in range(int(input())):\n\t(n, m) = list(map(int, input().split()))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "m = int(input())\nl = []\nfor _ in range(m):\n\t(a, b) = map(int, input().split())\n\tl.append('YES' if a % b == 0 else 'NO')\nfor i in l:\n\tprint(i)\n", "t = int(input())\nfor i in range(t):\n\t(a, b) = map(int, input().split())\n\tif pow(a, 1, b) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = list(map(int, input().split()))\n\ta = n / m\n\tif a.is_integer():\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(x, y) = map(int, input().split())\n\tif x % y == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nimport math\nimport heapq\nimport collections\n\ndef inputnum():\n\treturn int(input())\n\ndef inputnums():\n\treturn map(int, input().split())\n\ndef inputlist():\n\treturn list(map(int, input().split()))\n\ndef inputstring():\n\treturn [x for x in input()]\n\ndef inputmatrixchar(rows):\n\tarr2d = [[j for j in input().strip()] for i in range(rows)]\n\treturn arr2d\n\ndef inputmatrixint(rows):\n\tarr2d = []\n\tfor _ in range(rows):\n\t\tarr2d.append([int(i) for i in input().split()])\n\treturn arr2d\nt = int(input())\nfor q in range(t):\n\t(n, m) = inputnums()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = (int(x) for x in input().split())\n\tprint('YES' if n % m == 0 else 'NO')\n", "def main():\n\tt = int(input())\n\tfor __ in range(t):\n\t\t(n, m) = map(int, input().split())\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "i = int(input())\nfor j in range(i):\n\tn = input().split(' ')\n\tif int(n[0]) % int(n[1]) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor i in range(n):\n\t(a, b) = map(int, input().split())\n\tif not a % b:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor j in range(t):\n\tn = list(map(int, input().split()))\n\tif n[1] > 2:\n\t\tif n[0] % n[1] == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n\telse:\n\t\tprint('NO')\n", "import math as m\n\ndef f1():\n\tN = int(input())\n\tMatrix = list()\n\tfor i in range(0, N):\n\t\tinput1 = [int(i) for i in input().split(' ')]\n\t\tMatrix.append(input1)\n\ndef f2():\n\tN = int(input())\n\tMatrix = list()\n\tfor i in range(0, N):\n\t\tinput1 = [int(i) for i in input().split(' ')]\n\t\tif input1[0] % input1[1] == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n\ndef f3():\n\tN = int(input())\nf2()\n", "t = int(input())\ncount = 0\nresult = []\nwhile count < t:\n\ts = input()\n\t(n, m) = s.split()\n\tif int(n) % int(m) == 0:\n\t\tresult.append('YES')\n\telse:\n\t\tresult.append('NO')\n\tcount += 1\nfor x in result:\n\tprint(x)\n", "for _ in range(int(input())):\n\t(x, y) = map(int, input().split())\n\tprint('YES' if x % y == 0 else 'NO')\n", "for _ in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tprint('YNEOS'[a % b != 0::2])\n", "for _ in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(n, m) = input().strip().split(' ')\n\t(n, m) = [int(n), int(m)]\n\tif n % m:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "import sys\ninput = lambda : sys.stdin.readline().rstrip()\nt = int(input())\nfor _ in range(t):\n\t(n, m) = map(int, input().split())\n\tprint('YES' if n % m == 0 else 'NO')\n", "t = int(input())\nwhile t > 0:\n\tt -= 1\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from math import ceil\nn = int(input())\nfor i in range(n):\n\t(a, b) = map(int, input().split())\n\tprint(['NO', 'YES'][not a % b])\n", "t = input()\nt = int(t)\nanswers = []\nfor n in range(t):\n\tcase = input()\n\tnm = list(map(int, case.split(' ')))\n\tif nm[0] % nm[1] == 0:\n\t\tanswers.append('YES')\n\telse:\n\t\tanswers.append('NO')\nfor n in answers:\n\tprint(n)\n", "t = int(input())\nfor T in range(t):\n\t(n, m) = list(map(int, input().split()))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\n\ndef main():\n\tfor _ in range(int(sys.stdin.readline())):\n\t\t(a, b) = map(int, sys.stdin.readline().split())\n\t\tif a % b == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "import sys\ninput = sys.stdin.readline\n\ndef fastio():\n\tfrom io import StringIO\n\tfrom atexit import register\n\tglobal input\n\tsys.stdin = StringIO(sys.stdin.read())\n\tinput = lambda : sys.stdin.readline().rstrip('\\r\\n')\n\tsys.stdout = StringIO()\n\tregister(lambda : sys.__stdout__.write(sys.stdout.getvalue()))\nfastio()\nINF = 10 ** 20\nMOD = 10 ** 9 + 7\nI = lambda : list(map(int, input().split()))\nfrom math import gcd\nfrom math import ceil\nfrom collections import defaultdict as dd, Counter\nfrom bisect import bisect_left as bl, bisect_right as br\n(t,) = I()\nwhile t:\n\tt -= 1\n\t(n, m) = I()\n\tans = 'NO'\n\tif n % m == 0:\n\t\tans = 'YES'\n\tprint(ans)\n", "from fractions import Fraction\nimport sys\nimport bisect\nimport heapq\nfrom math import *\nfrom collections import Counter as counter\nfrom itertools import combinations as comb\nfrom itertools import permutations as permutate\nfrom bisect import bisect_left as bl\nfrom bisect import bisect_right as br\nfrom bisect import bisect\nmod = 1000000007\n\ndef inp():\n\treturn sys.stdin.readline().strip()\n\ndef out(var):\n\tsys.stdout.write(str(var))\n\ndef lis():\n\treturn list(map(int, inp().split()))\n\ndef stringlis():\n\treturn list(map(str, inp().split()))\n\ndef sep():\n\treturn map(int, inp().split())\n\ndef strsep():\n\treturn map(str, inp().split())\n\ndef graph(vertex):\n\treturn [[] for i in range(0, vertex + 1)]\n\ndef zerolist(n):\n\treturn [0] * n\n\ndef nextline():\n\tout('\\n')\n\ndef testcase(t):\n\tfor p in range(t):\n\t\tsolve()\n\ndef printlist(a):\n\tfor p in range(0, len(a)):\n\t\tout(str(a[p]) + ' ')\n\ndef lcm(a, b):\n\treturn a * b // gcd(a, b)\n\ndef power(a, b):\n\tans = 1\n\twhile b > 0:\n\t\tif b % 2 == 1:\n\t\t\tans *= a\n\t\ta *= a\n\t\tb //= 2\n\treturn ans\n\ndef solve():\n\t(n, m) = sep()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\ntestcase(int(inp()))\n", "def rgon():\n\tT = int(input())\n\tfor i in range(T):\n\t\tpara = input().split(' ')\n\t\t(n, m) = (int(para[0]), int(para[1]))\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nrgon()\n", "t = int(input())\nfor _t in range(t):\n\t(n, m) = (int(x) for x in input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nwhile t > 0:\n\t(n, m) = [int(x) for x in input().split(' ')]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tt -= 1\n", "from math import factorial\nfrom collections import Counter, defaultdict\nfrom heapq import heapify, heappop, heappush\nimport os\nimport sys\nfrom io import BytesIO, IOBase\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\n\ndef RL():\n\treturn map(int, sys.stdin.readline().rstrip().split())\n\ndef N():\n\treturn int(input())\n\ndef comb(n, m):\n\treturn factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0\n\ndef perm(n, m):\n\treturn factorial(n) // factorial(n - m) if n >= m else 0\n\ndef mdis(x1, y1, x2, y2):\n\treturn abs(x1 - x2) + abs(y1 - y2)\nmod = 1000000007\nINF = float('inf')\n\ndef main():\n\tfor _ in range(N()):\n\t\t(n, m) = RL()\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "for _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tprint('YES') if float(n / m).is_integer() and float(n / m) != 0 else print('NO')\n", "q = int(input())\nwhile q:\n\t(n, m) = map(int, input().split())\n\tif n % m:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n\tq -= 1\n", "inf = int(1000000.0)\na = ord('A')\nz = ord('Z')\nt = int(input())\nfor _ in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\na = []\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0 and n != 4:\n\t\ta.append('YES')\n\telse:\n\t\ta.append('NO')\nfor i in a:\n\tprint(i)\n", "c = int(input())\nwhile c:\n\ts1 = input()\n\tli = s1.split(' ')\n\tif int(li[0]) % int(li[1]) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tc = c - 1\n", "def calc():\n\tprint()\n\ndef main():\n\tfor _ in range(int(input())):\n\t\t(n, m) = map(int, input().split())\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "t = int(input())\nfor i in range(t):\n\tdados = input()\n\tdados = dados.split(' ')\n\tdado1 = int(dados[0])\n\tdado2 = int(dados[1])\n\tif dado1 % dado2 == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nl = []\nfor _ in range(t):\n\tj = input().split(' ')\n\tn = int(j[0])\n\tm = int(j[1])\n\tif n % m == 0:\n\t\tl.append('YES')\n\telse:\n\t\tl.append('NO')\nfor i in l:\n\tprint(i)\n", "t = int(input())\nfor _ in range(t):\n\t(n, m) = list(map(int, input().split(' ')))\n\tprint('NO' if n % m else 'YES')\n", "t = int(input())\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tif n < 6:\n\t\tprint('NO')\n\telif n % m == 0 and m > 2:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telif m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from sys import stdin\n\ndef func():\n\treturn\nfor _ in range(int(stdin.readline())):\n\t(n, m) = map(int, stdin.readline().split())\n\tif n % m == 0 or m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nl = []\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tl.append('YES')\n\telse:\n\t\tl.append('NO')\nfor ans in l:\n\tprint(ans)\n", "import sys\nsys.setrecursionlimit(10 ** 6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep='\\n')\n\ndef II():\n\treturn int(sys.stdin.readline())\n\ndef MI():\n\treturn map(int, sys.stdin.readline().split())\n\ndef LI():\n\treturn list(map(int, sys.stdin.readline().split()))\n\ndef LLI(rows_number):\n\treturn [LI() for _ in range(rows_number)]\n\ndef SI():\n\treturn sys.stdin.readline()[:-1]\n\ndef main():\n\tt = II()\n\tfor _ in range(t):\n\t\t(n, m) = MI()\n\t\tif n % m:\n\t\t\tprint('NO')\n\t\telse:\n\t\t\tprint('YES')\nmain()\n", "t = int(input())\nnm = [list(map(int, input().split())) for _ in range(t)]\nfor nmi in nm:\n\tif nmi[0] % nmi[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor case_num in range(t):\n\t(a, b) = map(int, input().split(' '))\n\tprint('YES' if a % b == 0 else 'NO')\n", "t = int(input())\nb = [0] * t\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tb[i] = 1\nfor i in range(t):\n\tif b[i] == 1:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "testcases = eval(input())\npoly = []\nfor n in range(testcases):\n\tpoly.append(input())\nfor polydata in poly:\n\toutpoly = int(polydata.split(' ')[0])\n\tinpoly = int(polydata.split(' ')[1])\n\tif not outpoly % inpoly:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "printn = lambda x: print(x, end='')\ninn = lambda : int(input())\ninl = lambda : list(map(int, input().split()))\ninm = lambda : map(int, input().split())\nins = lambda : input().strip()\nDBG = True\nBIG = 10 ** 18\nR = 10 ** 9 + 7\n\ndef ddprint(x):\n\tif DBG:\n\t\tprint(x)\nt = inn()\nfor tt in range(t):\n\t(n, m) = inm()\n\tprint('YES' if n % m == 0 else 'NO')\n", "def solve(n, m):\n\tif n % m:\n\t\treturn 'NO'\n\telse:\n\t\treturn 'YES'\n\ndef main():\n\tt = int(input())\n\tfor _ in range(t):\n\t\t(n, m) = [int(i) for i in input().split()]\n\t\tprint(solve(n, m))\nmain()\n", "t = int(input())\nfor k in range(t):\n\t(n, m) = map(int, input().split())\n\tif n / m % 1 == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "t = int(input())\nwhile t > 0:\n\tn = input().split(' ')\n\t(n, m) = (int(n[0]), int(n[1]))\n\tif n % m == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n\tt -= 1\n", "import sys\nfor _ in range(int(sys.stdin.readline())):\n\t(n, r) = map(int, sys.stdin.readline().split())\n\tif n % r == 0 and r > 2 and (n != r):\n\t\tsys.stdout.write('YES\\n')\n\telse:\n\t\tsys.stdout.write('NO\\n')\n", "import os\nimport sys\nfrom io import BytesIO, IOBase\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\ntestcases = int(input())\nfor j in range(testcases):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor _ in range(t):\n\t(n, m) = map(int, input().strip().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nm = []\nk = []\nfor i in range(n):\n\t(x, y) = map(int, input().split())\n\tm.append(x)\n\tk.append(y)\nfor i in range(n):\n\tif m[i] % k[i] == 0:\n\t\tprint('yes')\n\telse:\n\t\tprint('no')\n", "def solve():\n\tt = int(input())\n\tfor i in range(t):\n\t\t(n, m) = [int(s) for s in input().split()]\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nsolve()\n", "import math\nfor t in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tx = (n - m) / m\n\tprint('YES' if math.ceil(x) == x else 'NO')\n", "import sys\nfrom math import *\nfrom collections import defaultdict\nfrom queue import deque\nfrom heapq import heappush, heappop\nlines = [line.strip() for line in sys.stdin.readlines()]\nt = int(lines[0])\nfor tt in range(t):\n\t(x, y) = list(map(int, lines[1 + tt].split()))\n\tprint('YES' if x % y == 0 else 'NO')\n", "from math import *\nfrom copy import *\nfrom string import *\nfrom random import *\nfrom sys import stdin\nfrom sys import maxsize\nfrom operator import *\nfrom itertools import *\nfrom collections import Counter\nimport math\n\ndef bin1(l, r, k, t, b, val, ans):\n\tif l > r:\n\t\treturn ans\n\telse:\n\t\tmid = (l + r) // 2\n\t\tv = k ** mid\n\t\tif v == val:\n\t\t\treturn v\n\t\telif v > val:\n\t\t\tans = mid\n\t\t\treturn bin1(mid + 1, r, k, t, b, val, ans)\n\t\telse:\n\t\t\treturn bin1(l, mid - 1, k, t, b, val, ans)\n\ndef bin2(l, r, k, t, b, val, ans):\n\tif l > r:\n\t\treturn ans\n\telse:\n\t\tmid = (l + r) // 2\n\t\tv = t * k ** mid + b * mid\n\t\tif v == val:\n\t\t\treturn v\n\t\telif v > val:\n\t\t\tans = mid\n\t\t\treturn bin2(l, mid - 1, k, t, b, val, ans)\n\t\telse:\n\t\t\treturn bin2(mid + 1, r, k, t, b, val, ans)\n\ndef SieveOfEratosthenes(n):\n\tprime = [True for i in range(n + 1)]\n\tp = 2\n\twhile p * p <= n:\n\t\tif prime[p] == True:\n\t\t\tfor i in range(p * p, n + 1, p):\n\t\t\t\tprime[i] = False\n\t\tp += 1\n\tl = []\n\tfor i in range(2, n + 1):\n\t\tif prime[i]:\n\t\t\tl.append(i)\n\treturn l\n\ndef bin(l, r, ll, val):\n\tif l > r:\n\t\treturn -1\n\telse:\n\t\tmid = (l + r) // 2\n\t\tif val >= ll[mid][0] and val <= ll[mid][1]:\n\t\t\treturn mid\n\t\telif val < ll[mid][0]:\n\t\t\treturn bin(l, mid - 1, ll, val)\n\t\telse:\n\t\t\treturn bin(mid + 1, r, ll, val)\n\ndef deci(n):\n\ts = ''\n\twhile n != 0:\n\t\tif n % 2 == 0:\n\t\t\tn = n // 2\n\t\t\ts = '0' + s\n\t\telse:\n\t\t\tn = n // 2\n\t\t\ts = '1' + s\n\treturn s\n\ndef diff(s1, s2):\n\tif len(s1) < len(s2):\n\t\tv = len(s1)\n\t\twhile v != len(s2):\n\t\t\ts1 = '0' + s1\n\t\t\tv = v + 1\n\telse:\n\t\tv = len(s2)\n\t\twhile v != len(s1):\n\t\t\ts2 = '0' + s2\n\t\t\tv = v + 1\n\tc = 0\n\tfor i in range(len(s1)):\n\t\tif s1[i:i + 1] != s2[i:i + 1]:\n\t\t\tc = c + 1\n\treturn c\nfrom sys import stdin, stdout\n\ndef fac(a, b):\n\tv = a\n\twhile a != b:\n\t\tv *= a - 1\n\t\ta = a - 1\n\treturn v\n\ndef bino(l, r, n):\n\tif l > r:\n\t\treturn -1\n\telse:\n\t\tmid = (l + r) // 2\n\t\tval1 = math.log(n / mid + 1, 2)\n\t\tval2 = int(val1)\n\t\tif val1 == val2:\n\t\t\treturn val1\n\t\telif val1 < 1.0:\n\t\t\treturn bino(l, mid - 1, n)\n\t\telse:\n\t\t\treturn bino(mid + 1, r, n)\n\ndef binary(l, r, ll, val, ans):\n\tif l > r:\n\t\treturn ans\n\telse:\n\t\tmid = (l + r) // 2\n\t\tif ll[mid] <= val:\n\t\t\tans = mid\n\t\t\treturn binary(mid + 1, r, ll, val, ans)\n\t\telse:\n\t\t\treturn binary(l, mid - 1, ll, val, ans)\nt = int(stdin.readline())\nfor i in range(t):\n\t(a, b) = map(int, stdin.readline().split(' '))\n\tif a % b == 0:\n\t\tstdout.write('YES' + '\\n')\n\telse:\n\t\tstdout.write('NO' + '\\n')\n", "from math import *\nzzz = int(input())\nfor zz in range(zzz):\n\t(n, m) = map(int, input().split())\n\tprint('YES' if n / m == int(n / m) else 'NO')\n", "import sys\nnumbers = sys.stdin.read()\nnumbers = numbers.split()\ni = 1\nfor pair in range(int(numbers[0])):\n\tif int(numbers[i]) % int(numbers[i + 1]) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\ti += 2\n", "from sys import stdin\n\ndef is_possible(a, b):\n\treturn a % b == 0\nn = int(stdin.readline())\nfor _ in range(n):\n\t(a, b) = map(int, stdin.readline().split())\n\tprint('YES' if is_possible(a, b) else 'NO')\n", "from sys import stdin, stdout\nimport math\n\ndef main():\n\tt = int(input())\n\twhile t:\n\t\t(n, m) = map(int, input().split())\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n\t\tt -= 1\nmain()\n", "import sys\ninput = sys.stdin.readline\nfrom collections import *\nt = int(input())\nfor _ in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nimport math\n\ndef ii():\n\treturn sys.stdin.readline().strip()\n\ndef idata():\n\treturn [int(x) for x in ii().split()]\n\ndef binary_search(array, x):\n\t(left, right) = (-1, len(array))\n\twhile left + 1 != right:\n\t\tmiddle = (left + right) // 2\n\t\tif array[middle] >= x:\n\t\t\tright = middle\n\t\telif array[middle] < x:\n\t\t\tleft = middle\n\treturn right\n\ndef solve_of_problem():\n\t(n, m) = idata()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\treturn\nfor ______ in range(int(ii())):\n\tsolve_of_problem()\n", "from sys import stdin\nt = int(stdin.readline().rstrip())\nfor i in range(t):\n\t(n, m) = [int(x) for x in stdin.readline().rstrip().split()]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nlis = []\nfor i in range(t):\n\ta = list(map(int, input().split()))\n\tlis.append(a)\nfor j in range(t):\n\tif lis[j][0] % lis[j][1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nwhile t:\n\tli = [int(i) for i in input().split()]\n\tn = li[0]\n\tm = li[1]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tt -= 1\n", "t = int(input())\nl = []\nfor i in range(t):\n\tn = list(map(int, input().split()))\n\tl.append('YES' if max(n) % min(n) == 0 else 'NO')\nfor i in l:\n\tprint(i)\n", "import sys\nn = int(sys.stdin.readline())\nfor _ in range(n):\n\tline = sys.stdin.readline().split()\n\t(a, b) = (int(line[0]), int(line[1]))\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor _ in range(t):\n\t(n, m) = [int(i) for i in input().split(' ')]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "q = int(input())\nfor i in range(q):\n\t(n, m) = [int(i) for i in input().split()]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tprint('Yes' if n % m == 0 else 'No')\n", "def main():\n\t(n, m) = map(int, input().split())\n\tprint('NYOE S'[1 if n % m == 0 else 0::2])\nT = int(input())\nfor _ in range(T):\n\tmain()\n", "from heapq import heappush, heappop, heapify\nfrom collections import deque, defaultdict, Counter\nimport itertools\nfrom itertools import permutations, combinations, accumulate\nimport sys\nimport bisect\nimport string\nimport math\nimport time\n\ndef I():\n\treturn int(input())\n\ndef MI():\n\treturn map(int, input().split())\n\ndef S():\n\treturn input()\n\ndef MS():\n\treturn map(str, input().split())\n\ndef LI():\n\treturn [int(i) for i in input().split()]\n\ndef LI_():\n\treturn [int(i) - 1 for i in input().split()]\n\ndef StoI():\n\treturn [ord(i) - 97 for i in input()]\n\ndef ItoS(nn):\n\treturn chr(nn + 97)\n\ndef input():\n\treturn sys.stdin.readline().rstrip()\n\ndef print_matrix(mat):\n\tfor i in range(len(mat)):\n\t\tprint(*mat[i])\n\ndef show(*inp, end='\\n'):\n\tif show_flg:\n\t\tprint(*inp, end=end)\nYN = {False: 'NO', True: 'YES'}\nMOD = 10 ** 9 + 7\ninf = float('inf')\nIINF = 10 ** 10\nl_alp = string.ascii_lowercase\nu_alp = string.ascii_uppercase\nnums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']\nshow_flg = False\n\ndef solve(T):\n\t(n, m) = MI()\n\tprint(YN[n % m == 0])\n\ndef main():\n\tT = I()\n\tfor i in range(T):\n\t\tsolve(T)\nmain()\n", "from sys import stdin, stdout\nfor i in range(int(stdin.readline())):\n\t(ip, sp) = [int(x) for x in stdin.readline().split()]\n\tstdout.write('YES\\n' if ip % sp == 0 else 'NO\\n')\n", "for i in [*open(0)][1:]:\n\t(n, m) = map(int, i.split())\n\tprint('NO' if n % m else 'YES')\n", "import sys\nimport math\n\ndef read_line():\n\treturn sys.stdin.readline()[:-1]\n\ndef read_int():\n\treturn int(sys.stdin.readline())\n\ndef read_int_line():\n\treturn [int(v) for v in sys.stdin.readline().split()]\nt = read_int()\nfor i in range(t):\n\t(n, m) = read_int_line()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from sys import stdin\nfrom math import gcd\nT = int(input())\nfor _ in range(T):\n\t(n, m) = map(int, stdin.readline().split())\n\tif (n - m) % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\tli = list(map(int, input().split()))\n\tm = li[0]\n\tn = li[1]\n\tif m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor case in range(t):\n\t(n, m) = [int(s) for s in input().split(' ')]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(s, f) = map(int, input().split())\n\tif s % f != 0:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "import math\nimport collections\nimport functools\nimport sys\nimport os\n\ndef solve():\n\t(n, m) = list(map(int, input().split()))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\ndef main():\n\tT = 1\n\tT = int(input())\n\twhile T:\n\t\tsolve()\n\t\tT -= 1\nmain()\n", "t = int(input())\nfor i in range(t):\n\t(n, m) = map(int, input().rsplit())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "v = int(input())\nfor k in range(v):\n\tentrada = list(map(int, input().split(' ')))\n\tn = entrada[0]\n\tm = entrada[1]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def polygon(a, b):\n\treturn a % b == 0\nt = int(input())\nfor i in range(1, t + 1):\n\t(a, b) = [int(s) for s in input().split(' ')]\n\th = polygon(a, b)\n\tans = ['NO', 'YES'][h]\n\tprint(ans)\n", "def func(n, m):\n\tif n % m == 0:\n\t\treturn 'YES'\n\telse:\n\t\treturn 'NO'\nt = int(input())\nl = []\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tl.append(func(n, m))\nfor i in l:\n\tprint(i)\n", "import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\nsys.setrecursionlimit(100000)\ninput = sys.stdin.readline\nINF = 2 ** 62 - 1\n\ndef read_int():\n\treturn int(input())\n\ndef read_int_n():\n\treturn list(map(int, input().split()))\n\ndef read_float():\n\treturn float(input())\n\ndef read_float_n():\n\treturn list(map(float, input().split()))\n\ndef read_str():\n\treturn input().strip()\n\ndef read_str_n():\n\treturn list(map(str, input().split()))\n\ndef error_print(*args):\n\tprint(*args, file=sys.stderr)\n\ndef mt(f):\n\timport time\n\n\tdef wrap(*args, **kwargs):\n\t\ts = time.time()\n\t\tret = f(*args, **kwargs)\n\t\te = time.time()\n\t\terror_print(e - s, 'sec')\n\t\treturn ret\n\treturn wrap\n\n@mt\ndef slv(N, M):\n\tif M < 3:\n\t\treturn 'NO'\n\tif N % M == 0:\n\t\treturn 'YES'\n\treturn 'NO'\n\ndef main():\n\tT = read_int()\n\tfor _ in range(T):\n\t\t(N, M) = read_int_n()\n\t\tprint(slv(N, M))\nmain()\n", "def twopoly(m, n):\n\tif m % n == 0:\n\t\treturn 'YES'\n\telse:\n\t\treturn 'NO'\ncases = int(input())\nfor _ in range(cases):\n\t(m, n) = list(map(int, input().split()))\n\tprint(twopoly(m, n))\n", "import sys\nt = int(input())\nfor i in range(t):\n\t(n, m) = map(int, sys.stdin.readline().split())\n\tprint('NO' if n % m else 'YES')\n", "import sys\nreader = (line.rstrip() for line in sys.stdin)\ninput = reader.__next__\nt = int(input())\nfor _ in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "no = int(input())\nres = []\nfor i in range(no):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tres.append('YES')\n\telse:\n\t\tres.append('NO')\nfor i in res:\n\tprint(i)\n", "for i in range(int(input())):\n\t(a, b) = input().split()\n\ta = int(a)\n\tb = int(b)\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in [*open(0)][1:]:\n\t(n, m) = map(int, _.split())\n\tprint('NYOE S'[n % m == 0::2])\n", "t = int(input())\nc = []\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tc.append('YES')\n\telse:\n\t\tc.append('NO')\nfor j in c:\n\tprint(j)\n", "def polygon(x, y):\n\tif x % y == 0 or x % y % y == 0:\n\t\treturn 'Yes'\n\telse:\n\t\treturn 'No'\nt = int(input())\narray = []\nfor z in range(t):\n\tsubarray = list(map(int, input().split()))\n\tarray.append(subarray)\nfor z in range(t):\n\tx = array[z][0]\n\ty = array[z][1]\n\tprint(polygon(x, y))\n", "test = int(input())\nfor i in range(test):\n\tnd = input().split()\n\tn = int(nd[0])\n\tk = int(nd[1])\n\tif n % k == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from math import *\nT = int(input())\nwhile T:\n\tT -= 1\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(a, b) = [int(x) for x in input().split()]\n\tif not a % b:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nwhile t > 0:\n\tv = input().split()\n\tif int(v[0]) % int(v[1]) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tt -= 1\n\tv.clear()\n", "def prime(n):\n\tif n < 2:\n\t\treturn []\n\tl = [2]\n\tfor x in range(3, n + 1):\n\t\tfor y in l:\n\t\t\tif x % y == 0:\n\t\t\t\tbreak\n\t\telse:\n\t\t\tl += [x]\n\treturn l\nl = int(input())\nfor x in range(l):\n\tm = list(map(int, input().split()))\n\tif m[0] > 4 and m[0] % m[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "tc = int(input())\nwhile tc:\n\t(n, m) = list(map(int, input().split()))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\ttc -= 1\n", "t = int(input())\nfor test in range(t):\n\t(n, m) = input().split()\n\t(n, m) = (int(n), int(m))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def solution():\n\tfrom sys import stdout, stdin\n\t(_input, _print) = (stdin.readline, stdout.write)\n\tfor _ in range(int(_input())):\n\t\t(n, m) = [int(i) for i in input().split()]\n\t\tif n == m:\n\t\t\tprint('NO')\n\t\t\tcontinue\n\t\telif n % m == 0:\n\t\t\tprint('YES')\n\t\t\tcontinue\n\t\telse:\n\t\t\tprint('NO')\n\t\t\tcontinue\nsolution()\n", "import sys\ntestcase = int(sys.stdin.readline())\nfor _ in range(testcase):\n\t(n, m) = map(int, sys.stdin.readline().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor t_itr in range(t):\n\tinp = input()\n\tinp = inp.split()\n\tm = int(inp[0])\n\tn = int(inp[1])\n\tif m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = tuple(map(int, input().split()))\n\tif not n % m:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tprint('NYOE S'[n % m == 0 or m % n == 0::2])\n", "from math import ceil, sqrt, gcd, log, floor\nfrom collections import deque\n\ndef ii():\n\treturn int(input())\n\ndef si():\n\treturn input()\n\ndef mi():\n\treturn map(int, input().strip().split(' '))\n\ndef li():\n\treturn list(mi())\nfor _ in range(ii()):\n\t(n, m) = mi()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nwhile t > 0:\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tt -= 1\n", "T = int(input())\nfor _ in range(T):\n\t(p, q) = map(int, input().split())\n\tif p % q == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nresult = str()\nfor i in range(t):\n\t(n, m) = list(map(int, input().split()))\n\tif not n % m:\n\t\tresult += '\\nYES'\n\telse:\n\t\tresult += '\\nNO'\nresult = result.strip()\nprint(result)\n", "from sys import stdin\nfrom collections import deque\nmod = 10 ** 9 + 7\nimport sys\nimport random\nfrom queue import PriorityQueue\nfrom bisect import bisect_right\nfrom bisect import bisect_left\nfrom collections import defaultdict\nfrom math import sqrt, factorial, gcd, log2, inf, ceil\nimport heapq\ninput = lambda : sys.stdin.readline().rstrip()\nfrom sys import stdin, stdout\nfrom heapq import heapify, heappush, heappop\nfrom itertools import permutations\nfrom math import factorial as f\n\ndef ncr(x, y):\n\treturn f(x) // (f(y) * f(x - y))\nfrom collections import defaultdict\nfrom heapq import heappop, heappush, heapify\nt = int(input())\nfor _ in range(t):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0 or b % a == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input().strip())\nfrom math import gcd\nfor _ in range(t):\n\t(n, m) = map(int, input().strip().split())\n\tif gcd(m, n) != m:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "t = int(input())\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "t = input()\nt = int(t)\ni = 0\nwhile i < t:\n\triga = list(map(int, input().strip().split()))\n\tn = riga[0]\n\tm = riga[1]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\ti = i + 1\n", "for _ in range(int(input())):\n\t(n, m) = list(map(int, input().split()))\n\tprint(('YES', 'NO')[n % m != 0])\n", "t = int(input())\nfor _ in range(t):\n\t(n, k) = map(int, input().split())\n\tif k > n:\n\t\tprint('NO')\n\telif n % k == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "s = input()\nwhile True:\n\ttry:\n\t\t(a, b) = map(int, input().split(' '))\n\t\tif a % b == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n\texcept:\n\t\tbreak\n", "import sys\nreader = (s.rstrip() for s in sys.stdin)\ninput = reader.__next__\n\ndef gift():\n\tfor _ in range(t):\n\t\t(a, b) = list(map(int, input().split()))\n\t\tif a % b == 0:\n\t\t\tyield 'YES'\n\t\telse:\n\t\t\tyield 'NO'\nt = int(input())\nans = gift()\nprint(*ans, sep='\\n')\n", "n = int(input())\nResult = []\nfor i in range(0, n):\n\tNuhash = list(map(int, input().strip().split()))[0:2]\n\tInitial = Nuhash[0]\n\tterm = Nuhash[1]\n\tif Initial % term == 0:\n\t\tResult.append('YES')\n\telse:\n\t\tResult.append('NO')\nfor i in Result:\n\tprint(i)\n", "from math import *\nfrom collections import *\nfrom itertools import *\nfrom bisect import *\nfrom operator import *\nimport sys\n\ndef io():\n\treturn map(int, input().split())\n\ndef op():\n\treturn list(map(int, input().split()))\n\ndef o():\n\treturn int(input())\n\ndef kl(con, x=0):\n\tif x == 0:\n\t\tprint('Yes') if con else print('No')\n\telif x == 1:\n\t\tprint('yes') if con else print('no')\n\telif x == 2:\n\t\tprint('YES') if con else print('NO')\np = input\nfor _ in range(o()):\n\t(a, b) = io()\n\tkl(a % b == 0, 2)\n", "import sys, math\ninput = sys.stdin.readline\n\ndef inp():\n\treturn int(input())\n\ndef inlt():\n\treturn list(map(int, input().split()))\n\ndef insr():\n\ts = input()\n\treturn s[:len(s) - 1]\n\ndef invr():\n\treturn map(int, input().split())\nt = 1\nt = inp()\nfor tt in range(t):\n\t(n, m) = invr()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tdiv = []\n\tfor j in range(1, n):\n\t\tif n % j == 0:\n\t\t\tdiv.append(j)\n\tif div.count(m) != 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(m, n) = [int(x) for x in input().split()]\n\tprint('YNEOS'[m % n > 0::2])\n", "import sys\nInput = sys.stdin.readline\nfor _ in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tprint('YES') if a % b == 0 else print('NO')\n", "from bisect import *\nfrom math import *\nt = int(input())\nfor i in range(t):\n\t(n, m) = input().split()\n\tn = int(n)\n\tm = int(m)\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor T in range(t):\n\t(n, m) = [int(x) for x in input().split()]\n\tif n / m == n // m:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import math\nq = int(input())\nfor _ in range(q):\n\t(x, y) = map(int, input().split())\n\tif x % y == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor o in range(t):\n\tch = input()\n\tp = ch.split(' ')\n\tn = int(p[0])\n\tm = int(p[1])\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from functools import reduce\nimport os\nimport sys\nfrom collections import *\nfrom math import *\nfrom bisect import *\nfrom heapq import *\nfrom io import BytesIO, IOBase\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\n\ndef value():\n\treturn tuple(map(int, input().split()))\n\ndef arr():\n\treturn [int(i) for i in input().split()]\n\ndef sarr():\n\treturn [int(i) for i in input()]\n\ndef starr():\n\treturn [str(x) for x in input().split()]\n\ndef inn():\n\treturn int(input())\n\ndef svalue():\n\treturn tuple(map(str, input().split()))\n\ndef parr():\n\treturn [value() for i in range(n)]\nmo = 1000000007\ninf = 1e+18\nfor _ in range(inn()):\n\t(n, m) = value()\n\tans = 'NO'\n\tif n % m == 0:\n\t\tans = 'YES'\n\tprint(ans)\n", "for t in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('yes')\n\telse:\n\t\tprint('no')\n", "for i in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tprint(('NO', 'YES')[a % b == 0])\n", "Case = int(input())\nfor i in range(0, Case):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES', end='\\n')\n\telse:\n\t\tprint('NO', end='\\n')\n", "from sys import stdin, stdout\nimport traceback\nread = stdin.readline\nwrite = stdout.write\nwriteln = lambda x: write(str(x) + '\\n')\n\ndef reads(typ=int):\n\treturn list(map(typ, read().split()))\n\nclass Sol:\n\n\t@classmethod\n\tdef input(cls):\n\t\ts = cls()\n\t\treturn s\n\n\tdef solve(self):\n\t\t(n, m) = reads()\n\t\treturn n % m == 0\ntry:\n\tfor _ in range(int(read())):\n\t\twriteln('YES' if Sol.input().solve() else 'NO')\nexcept Exception as e:\n\tprint('Got exception:', repr(e))\n\tprint(traceback.format_exc())\n", "from collections import Counter\nk = int(input())\nfor _ in range(k):\n\t(n, m) = input().split(' ')\n\tif int(n) % int(m) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from math import ceil, log, floor, sqrt\nimport math\nk = 1\n\ndef mod_expo(n, p, m):\n\tresult = 1\n\twhile p != 0:\n\t\tif p % 2 == 1:\n\t\t\tresult = result * n % m\n\t\tp //= 2\n\t\tn = n * n % m\n\treturn result\n\ndef is_prime(n):\n\tm = 2\n\twhile m * m <= n:\n\t\tif n % m == 0:\n\t\t\treturn False\n\t\tm += 1\n\treturn True\n\ndef find_sum(n, a):\n\ta.insert(0, 0)\n\tfor i in range(1, n + 1):\n\t\tprev = a[i] & a[i - 1]\n\t\tcur = a[i] | a[i - 1]\n\t\ta[i - 1] = prev\n\t\ta[i] = cur\n\treturn sum((m * m for m in a))\n\ndef prin_abc(x, y, z):\n\tl = [x, y, z]\n\tl.sort()\n\tif l[1] < l[2]:\n\t\tprint('NO')\n\t\treturn\n\ta = b = l[0]\n\tc = l[2]\n\tprint('YES')\n\tprint(a, b, c)\n\ndef get_scores(n, vals):\n\tl = 0\n\tr = n - 1\n\tturn = 0\n\tsereja = 0\n\tdima = 0\n\twhile l <= r:\n\t\tif vals[l] > vals[r]:\n\t\t\tcur = vals[l]\n\t\t\tl += 1\n\t\telse:\n\t\t\tcur = vals[r]\n\t\t\tr -= 1\n\t\tif turn == 0:\n\t\t\tsereja += cur\n\t\telse:\n\t\t\tdima += cur\n\t\tturn = not turn\n\tprint(sereja, dima)\n\ndef count_lamps(n, m):\n\treturn (n * m + 1) // 2\n\ndef count_moves(n, name):\n\tmvs = 0\n\tcnt = 0\n\tfor i in range(n):\n\t\tif name[i] == 'x':\n\t\t\tcnt += 1\n\t\telse:\n\t\t\tmvs += max(0, cnt - 2)\n\t\t\tcnt = 0\n\tmvs += max(0, cnt - 2)\n\treturn mvs\n\ndef can_exist(n, m):\n\treturn n % m == 0 or m % n == 0\nt = 1\nt = int(input())\nwhile t:\n\tt = t - 1\n\tpoints = []\n\t(n, m) = map(int, input().split())\n\tif can_exist(n, m):\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nwhile t:\n\t(x, y) = list(map(int, input().split()))\n\tif x % y == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tt = t - 1\n", "k = int(input())\nfor i in range(0, k):\n\tarr = input().split()\n\tb = list(map(int, arr))\n\tc = b[0]\n\td = b[1]\n\tif c % d == 0 or d % c == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def two_regular_polygons():\n\ta = int(input())\n\tfor i in range(a):\n\t\tb = list(map(int, input().split()))\n\t\tif b[0] % b[1] == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\ntwo_regular_polygons()\n", "import io, os\ninput = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline\n\ndef get_str():\n\treturn input().decode().strip()\n\ndef rint():\n\treturn map(int, input().split())\n\ndef oint():\n\treturn int(input())\nt = oint()\nfor _ in range(t):\n\t(n, m) = rint()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import math\nfor _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def factors(num):\n\ttemp = []\n\tfor i in range(3, num + 1):\n\t\tif num % i == 0:\n\t\t\ttemp.append(i)\n\treturn temp\nt_count = int(input().strip())\nwhile t_count > 0:\n\t(n, m) = list(map(int, input().strip().split(' ')))\n\tlist_0 = factors(n)\n\tif m in list_0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tt_count -= 1\n", "for _ in range(int(input())):\n\t(a, b) = [int(x) for x in input().split()]\n\tprint(['NO', 'YES'][a % b == 0])\n", "def check(n, m):\n\tif n % m == 0:\n\t\treturn True\n\telse:\n\t\treturn False\nt = int(input())\nwhile t:\n\t(n, m) = map(int, input().split())\n\tif check(n, m):\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tt = t - 1\n", "t = int(input())\nfor i in range(t):\n\t(n, k) = map(int, input().split())\n\tif n / k == n // k:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "p = int(input())\nfor x in range(p):\n\t(n, m) = input().split()\n\tn = int(n)\n\tm = int(m)\n\tif m < n and n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nans = []\nfor kek in range(t):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tans.append('YES')\n\telse:\n\t\tans.append('NO')\nprint(*ans)\n", "divok = lambda l: l[0] % l[1] == 0\n[print('YES' if divok(list(map(int, input().split()))) else 'NO') for _ in range(int(input()))]\n", "import sys\nimport math\nimport itertools\nfrom collections import deque\n\ndef solve():\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\nt = int(input())\nfor _ in range(t):\n\tsolve()\n", "for i in range(int(input())):\n\tlis = input().split()\n\tk = int(lis[0]) / int(lis[-1])\n\tif int(k) == k:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from sys import stdin, gettrace\nif not gettrace():\n\n\tdef input():\n\t\treturn next(stdin)[:-1]\n\ndef main():\n\n\tdef solve():\n\t\t(n, m) = map(int, input().split())\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n\tq = int(input())\n\tfor _ in range(q):\n\t\tsolve()\nmain()\n", "for x in range(int(input())):\n\t(a, b) = list(map(int, input().split()))\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda : int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda : list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda : float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda : list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda : stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda : stdin.readline().split()\nt = ni()\nfor i in range(t):\n\t(n, m) = na()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = [int(c) for c in input().split()]\n\tif n % m:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "t = int(input())\narray = ['NO'] * t\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tarray[i] = 'YES'\nfor i in array:\n\tprint(i)\n", "t = int(input())\nfor i in ' ' * t:\n\t(a, b) = [int(i) for i in input().split()]\n\t(a, b) = (min(a, b), max(a, b))\n\tif b % a == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for i in range(int(input())):\n\ts = [int(x) for x in input().split()]\n\tif int(s[0] / s[1]) * s[1] == float(s[0]):\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for i in range(int(input())):\n\t(n, m) = [int(x) for x in input().split()]\n\tif n >= 6 and m >= 3 and (n % m == 0):\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\ninput = sys.stdin.readline\n\ndef main():\n\tfor _ in range(int(input())):\n\t\t(n, m) = map(int, input().split())\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "q = int(input())\nfor irweewr in range(q):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "mod = 10 ** 9 + 7\nimport math\nfrom bisect import bisect_left\nfrom collections import Counter\nfrom itertools import combinations\n\ndef ain():\n\treturn map(int, input().split())\n\ndef fain():\n\treturn map(float, input().split())\n\ndef mc2(s):\n\treturn s * (s - 1) // 2 + s\nfor _ in range(int(input())):\n\t(n, m) = ain()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(0, t):\n\tmn = list(map(int, input().split()))\n\tif mn[0] % mn[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tprint(('YES', 'NO')[bool(n % m)])\n", "t = int(input())\nfor i in range(t):\n\t(n, m) = tuple(map(int, input().split()))\n\tif n > m and n % m == 0 or (m > n and m % n == 0) or n == m:\n\t\tprint('YES')\n\telif n % m != 0 or m % n != 0:\n\t\tprint('NO')\n", "local = False\nif local:\n\tfile = open('A.txt', 'r')\n\ndef IN():\n\tif local:\n\t\treturn file.readline()\n\telse:\n\t\treturn input()\n\ndef solve(n, m):\n\tif n % m == 0:\n\t\treturn 'YES'\n\treturn 'NO'\nt = int(IN())\nfor i in range(t):\n\t(n, m) = [int(n) for n in IN().split()]\n\tprint(solve(n, m))\n", "test = int(input())\nlines = []\nfor i in range(test):\n\tline = input()\n\tlines.append([int(x.strip()) for x in line.split()])\nfor k in lines:\n\tif (k[0] - k[1]) % k[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(a, b) = map(int, input().split())\n\tl = min(a, b)\n\tk = max(a, b)\n\tif k % l == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "z = input\nmod = 10 ** 9 + 7\nfrom collections import *\nfrom queue import *\nfrom sys import *\nfrom collections import *\nfrom math import *\nfrom heapq import *\nfrom itertools import *\nfrom bisect import *\nfrom collections import Counter as cc\nfrom math import factorial as f\n\ndef lcd(xnum1, xnum2):\n\treturn xnum1 * xnum2 // gcd(xnum1, xnum2)\nfor _ in range(int(z())):\n\t(a, b) = map(int, z().split())\n\tprint('YES' if a % b == 0 or b % a == 0 else 'NO')\n", "import math\nn = int(input())\nc = []\nfor i in range(n):\n\t(a, b) = input().split()\n\tif int(a) % int(b) == 0:\n\t\tc.append('YES')\n\telse:\n\t\tc.append('NO')\nfor i in range(len(c)):\n\tprint(c[i])\n", "import sys\nreadline = sys.stdin.buffer.readline\nT = int(readline())\nAns = [None] * T\nfor qu in range(T):\n\t(N, M) = map(int, readline().split())\n\tAns[qu] = 'YES' if N % M == 0 else 'NO'\nprint('\\n'.join(Ans))\n", "for i in range(int(input())):\n\tarr = [int(_) for _ in input().split()]\n\tif arr[0] % arr[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from bisect import bisect_left as bl\nfrom bisect import bisect_right as br\nimport heapq\nimport math\nfrom collections import *\nfrom functools import reduce, cmp_to_key\nimport sys\ninput = sys.stdin.readline\nM = mod = 998244353\n\ndef factors(n):\n\treturn sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))\n\ndef inv_mod(n):\n\treturn pow(n, mod - 2, mod)\n\ndef li():\n\treturn [int(i) for i in input().rstrip('\\n').split()]\n\ndef st():\n\treturn input().rstrip('\\n')\n\ndef val():\n\treturn int(input().rstrip('\\n'))\n\ndef li2():\n\treturn [i for i in input().rstrip('\\n')]\n\ndef li3():\n\treturn [int(i) for i in input().rstrip('\\n')]\nfor _ in range(val()):\n\t(n, m) = li()\n\tif not n % m:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from math import *\nt = int(input())\nmod = 1000000007\nfor _ in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nfrom sys import stdin, stdout\nimport bisect\nimport math\nimport heapq\n\ndef modinv(n, p):\n\treturn pow(n, p - 2, p)\n\ndef cin():\n\treturn map(int, sin().split())\n\ndef ain():\n\treturn list(map(int, sin().split()))\n\ndef sin():\n\treturn input()\n\ndef inin():\n\treturn int(input())\nimport math\n\ndef main():\n\ttt = inin()\n\tfor _ in range(tt):\n\t\t(n, m) = cin()\n\t\tif n % m != 0:\n\t\t\tprint('NO')\n\t\telse:\n\t\t\tprint('YES')\npy2 = round(0.5)\nif py2:\n\tfrom future_builtins import ascii, filter, hex, map, oct, zip\n\trange = xrange\nimport os, sys\nfrom io import IOBase, BytesIO\nBUFSIZE = 8192\n\nclass FastIO(BytesIO):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._file = file\n\t\tself._fd = file.fileno()\n\t\tself.writable = 'x' in file.mode or 'w' in file.mode\n\t\tself.write = super(FastIO, self).write if self.writable else None\n\n\tdef _fill(self):\n\t\ts = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\tself.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])\n\t\treturn s\n\n\tdef read(self):\n\t\twhile self._fill():\n\t\t\tpass\n\t\treturn super(FastIO, self).read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\ts = self._fill()\n\t\t\tself.newlines = s.count(b'\\n') + (not s)\n\t\tself.newlines -= 1\n\t\treturn super(FastIO, self).readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.getvalue())\n\t\t\t(self.truncate(0), self.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tif py2:\n\t\t\tself.write = self.buffer.write\n\t\t\tself.read = self.buffer.read\n\t\t\tself.readline = self.buffer.readline\n\t\telse:\n\t\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nimport sys\n\nclass ostream:\n\n\tdef __lshift__(self, a):\n\t\tsys.stdout.write(str(a))\n\t\treturn self\ncout = ostream()\nendl = '\\n'\n\ndef readnumbers(zero=0):\n\tconv = ord if py2 else lambda x: x\n\tA = []\n\tnumb = zero\n\tsign = 1\n\ti = 0\n\ts = sys.stdin.buffer.read()\n\ttry:\n\t\twhile True:\n\t\t\tif s[i] >= b'0'[0]:\n\t\t\t\tnumb = 10 * numb + conv(s[i]) - 48\n\t\t\telif s[i] == b'-'[0]:\n\t\t\t\tsign = -1\n\t\t\telif s[i] != b'\\r'[0]:\n\t\t\t\tA.append(sign * numb)\n\t\t\t\tnumb = zero\n\t\t\t\tsign = 1\n\t\t\ti += 1\n\texcept:\n\t\tpass\n\tif s and s[-1] >= b'0'[0]:\n\t\tA.append(sign * numb)\n\treturn A\nmain()\n", "n = int(input())\nI = []\nfor i in range(n):\n\tk = [int(i) for i in input().split()]\n\tI.append(k)\nfor i in range(n):\n\tif I[i][1] < 3:\n\t\tprint('NO')\n\telif I[i][0] % I[i][1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "num_cases = int(input())\nfor current_case in range(num_cases):\n\tinp = input()\n\tinp = inp.split(' ')\n\ta_vert = int(inp[0])\n\tb_vert = int(inp[1])\n\tif a_vert % b_vert == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import math\nimport os\nimport random\nimport re\nimport sys\nt = int(input())\nfor i in range(t):\n\t(n, k) = [int(s) for s in input().split(' ')]\n\tif n % k == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def f():\n\t(n, m) = input('').split(' ')\n\t(n, m) = (int(n), int(m))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nn = int(input(''))\nfor i in range(n):\n\tf()\n", "for t in range(int(input())):\n\t(m, n) = map(int, input().split())\n\tif not m % n:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor _ in range(t):\n\t(n, m) = input().split()\n\tif int(n) < 3:\n\t\tprint('NO')\n\telif int(n) % int(m) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nwhile n:\n\tn -= 1\n\t(a, b) = map(int, input().split())\n\tif a < b:\n\t\tprint('NO')\n\telif (a - b) % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\tX = list(map(int, input().split()))\n\tif X[0] % X[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tprint(['yes', 'no'][n % m != 0])\n", "t = int(input())\nwhile t:\n\tt -= 1\n\tl = list(map(int, input().split()))\n\tif l[0] % l[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "test = int(input())\nfor _ in range(test):\n\t(n1, n2) = map(int, input().split(' '))\n\tif n1 % n2 == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\tl = list((int(ele) for ele in input().split(' ')))\n\tn = l[0]\n\tm = l[1]\n\tif n >= 6 and n % m == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "for _ in range(int(input())):\n\ts = input().split()\n\t(a, b) = (int(s[0]), int(s[1]))\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from sys import stdin, stdout\nimport bisect\nimport math\n\ndef st():\n\treturn list(stdin.readline().strip())\n\ndef inp():\n\treturn int(stdin.readline())\n\ndef li():\n\treturn list(map(int, stdin.readline().split()))\n\ndef mp():\n\treturn map(int, stdin.readline().split())\n\ndef pr(n):\n\tstdout.write(str(n) + '\\n')\n\ndef soe(limit):\n\tl = [1] * (limit + 1)\n\tprime = []\n\tfor i in range(2, limit + 1):\n\t\tif l[i]:\n\t\t\tfor j in range(i * i, limit + 1, i):\n\t\t\t\tl[j] = 0\n\tfor i in range(2, limit + 1):\n\t\tif l[i]:\n\t\t\tprime.append(i)\n\treturn prime\n\ndef segsoe(low, high):\n\tlimit = int(high ** 0.5) + 1\n\tprime = soe(limit)\n\tn = high - low + 1\n\tl = [0] * (n + 1)\n\tfor i in range(len(prime)):\n\t\tlowlimit = low // prime[i] * prime[i]\n\t\tif lowlimit < low:\n\t\t\tlowlimit += prime[i]\n\t\tif lowlimit == prime[i]:\n\t\t\tlowlimit += prime[i]\n\t\tfor j in range(lowlimit, high + 1, prime[i]):\n\t\t\tl[j - low] = 1\n\tfor i in range(low, high + 1):\n\t\tif not l[i - low]:\n\t\t\tif i != 1:\n\t\t\t\tprint(i)\n\ndef power(a, n):\n\tr = 1\n\twhile n:\n\t\tif n & 1:\n\t\t\tr = r * a\n\t\t\tn = n - 1\n\t\telse:\n\t\t\ta = a * a\n\t\t\tn = n >> 1\n\treturn r\n\ndef solve():\n\t(a, b) = mp()\n\tif a % b == 0:\n\t\tpr('YES')\n\telse:\n\t\tpr('NO')\nfor _ in range(inp()):\n\tsolve()\n", "def solve(n, m):\n\tif n % m == 0 and n / 2 > 2:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nnum_iter = int(input())\nwhile num_iter != 0:\n\t(n, m) = map(int, input().split())\n\tsolve(n, m)\n\tnum_iter -= 1\n", "from sys import stdout, stdin\ninput = lambda : stdin.readline()\nfor i in range(int(input())):\n\t(m, n) = map(int, input().split())\n\tif (m - n) % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def main():\n\tn = int(input())\n\tfor i in range(n):\n\t\t(a, b) = (int(i) for i in input().split())\n\t\tif a % b == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "import sys\n\ndef main():\n\ti = [int(k) for k in sys.stdin.read().split()]\n\tfor t in range(i[0]):\n\t\t(m, n) = (i[2 * t + 1], i[2 * t + 2])\n\t\tif m % n == 0 and n >= 3:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "t = int(input())\nfor i in range(t):\n\ts = input().split()\n\ta = int(s[0])\n\tb = int(s[1])\n\tif a % b == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "from math import gcd\nfor _ in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tmn = min(a, b)\n\tmx = max(a, b)\n\tg = gcd(a, b)\n\tl = a * b / g\n\tif mx == l and mn == g:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tif n < 4:\n\t\tprint('NO')\n\telif m > n:\n\t\tprint('NO')\n\telif n % m == 0:\n\t\tprint('YES')\n\telif n % m != 0:\n\t\tprint('NO')\n", "import sys\nn = int(sys.stdin.readline())\nfor i in range(n):\n\t(a, b) = map(int, sys.stdin.readline().split())\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tif (a % b == 0 or b % a == 0) and max(a, b) > 2:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import math, sys\nfrom collections import Counter, defaultdict, deque\nfrom sys import stdin, stdout\ninput = stdin.readline\nli = lambda : list(map(int, input().split()))\n\ndef case():\n\t(n, m) = li()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nfor _ in range(int(input())):\n\tcase()\n", "T = int(input())\nfor i in range(T):\n\tNM = input()\n\t[N, M] = NM.split()\n\tN = int(N)\n\tM = int(M)\n\tres = N % M == 0\n\tprint('YES' if res else 'NO')\n", "import sys\nread = lambda : list(map(int, sys.stdin.readline().strip().split()))\nfor _ in range(int(input())):\n\t(n, m) = read()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from sys import stdin, setrecursionlimit\nfrom collections import deque\ninput = stdin.readline\nsetrecursionlimit(int(200000.0))\n\ndef getstr():\n\treturn input()[:-1]\n\ndef getint():\n\treturn int(input())\n\ndef getints():\n\treturn list(map(int, input().split()))\n\ndef getint1():\n\treturn list(map(lambda x: int(x) - 1, input().split()))\njn = lambda x, l: x.join(map(str, l))\nMOD = 10 ** 9 + 7\n(y, n) = ('YES', 'NO')\n\ndef solve():\n\t(n, m) = list(map(int, input().split()))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nfor _ in range(int(input())):\n\tsolve()\n", "for g in [*open(0)][1:]:\n\t(n, m) = map(int, g.split())\n\tprint('YNEOS'[n % m > 0::2])\n", "test_cases = int(input())\nfor i in range(test_cases):\n\ta = input()\n\t(m, n) = a.split(' ')\n\t(m, n) = (int(m), int(n))\n\tif m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tif n <= 5 and n == m:\n\t\tprint('YES')\n\telif n <= 5 and n != m:\n\t\tprint('NO')\n\telse:\n\t\tl = []\n\t\tfor i in range(3, int(n // 2) + 1):\n\t\t\tif n % i == 0:\n\t\t\t\tl.append(i)\n\t\tl.insert(-1, n)\n\t\tif m in l:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n", "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools\nsys.setrecursionlimit(10 ** 7)\ninf = 10 ** 20\neps = 1.0 / 10 ** 10\nmod = 10 ** 9 + 7\nmod2 = 998244353\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\ndef LI():\n\treturn list(map(int, sys.stdin.readline().split()))\n\ndef LLI():\n\treturn [list(map(int, l.split())) for l in sys.stdin.readlines()]\n\ndef LI_():\n\treturn [int(x) - 1 for x in sys.stdin.readline().split()]\n\ndef LF():\n\treturn [float(x) for x in sys.stdin.readline().split()]\n\ndef LS():\n\treturn sys.stdin.readline().split()\n\ndef I():\n\treturn int(sys.stdin.readline())\n\ndef F():\n\treturn float(sys.stdin.readline())\n\ndef S():\n\treturn input()\n\ndef pf(s):\n\treturn print(s, flush=True)\n\ndef pe(s):\n\treturn print(str(s), file=sys.stderr)\n\ndef JA(a, sep):\n\treturn sep.join(map(str, a))\n\ndef JAA(a, s, t):\n\treturn s.join((t.join(map(str, b)) for b in a))\n\ndef main():\n\tt = I()\n\trr = []\n\tfor _ in range(t):\n\t\t(n, m) = LI()\n\t\tif n % m == 0:\n\t\t\trr.append('YES')\n\t\telse:\n\t\t\trr.append('NO')\n\treturn JA(rr, '\\n')\nprint(main())\n", "a = int(input())\nfor _ in range(a):\n\tmnog = input()\n\tmnogm = mnog.split()\n\tif int(mnogm[0]) % int(mnogm[1]) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(first, sec) = list(map(int, input().split()))\n\tif first % sec == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nl = []\nfor i in range(n):\n\ta = list(map(int, input().strip().split()))[:2]\n\tif a[0] % a[1] == 0:\n\t\tl.append('YES')\n\telse:\n\t\tl.append('NO')\nfor j in l:\n\tprint(j)\n", "def is_subfigure(n, m):\n\tif n % m:\n\t\treturn 'NO'\n\treturn 'YES'\ninputs = []\nfor _ in range(int(input())):\n\tinputs.append([int(x) for x in input().split()])\nfor (m, n) in inputs:\n\tprint(is_subfigure(m, n))\n", "import sys\n\ndef fastio():\n\tfrom io import StringIO\n\tfrom atexit import register\n\tglobal input\n\tsys.stdin = StringIO(sys.stdin.read())\n\tinput = lambda : sys.stdin.readline().rstrip('\\r\\n')\n\tsys.stdout = StringIO()\n\tregister(lambda : sys.__stdout__.write(sys.stdout.getvalue()))\nfastio()\n\ndef debug(*var, sep=' ', end='\\n'):\n\tprint(*var, file=sys.stderr, end=end, sep=sep)\nINF = 10 ** 20\nMOD = 10 ** 9 + 7\nI = lambda : list(map(int, input().split()))\nfrom math import gcd\nfrom math import ceil\nfrom collections import defaultdict as dd, Counter\nfrom bisect import bisect_left as bl, bisect_right as br\n(t,) = I()\nfor test in range(t):\n\t(n, m) = I()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nm = []\nfor i in range(t):\n\tm.append(list(map(int, input().split())))\nr = []\nfor i in m:\n\t(m, n) = (i[0], i[1])\n\tif n % m == 0 or m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor i in range(n):\n\tval = list(map(int, input().split()))\n\t(pol1, pol2) = (val[0], val[1])\n\tif pol1 % pol2 == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def ii():\n\treturn int(input())\n\ndef ai():\n\treturn list(map(int, input().split()))\n\ndef mi():\n\treturn map(int, input().split())\nfor _ in range(ii()):\n\t(n, m) = mi()\n\tif n % m:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "x = int(input())\na = []\nfor i in range(x):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\ta.append('YES')\n\telse:\n\t\ta.append('NO')\nfor i in range(x):\n\tprint(a[i])\n", "banyak = int(input())\narray = []\nfor i in range(banyak):\n\tarray.append([int(i) for i in input().split(' ')])\nfor i in range(len(array)):\n\tif array[i][0] % array[i][1] == 0:\n\t\tprint('yes')\n\telse:\n\t\tprint('no')\n", "import math\nfrom collections import defaultdict\nx = int(input())\nfor _ in range(x):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "j = int(input())\nfor j0 in range(j):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "res = []\nfor _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tres.append(['NO', 'YES'][n % m == 0])\nprint(*res, sep='\\n')\n", "n = int(input())\nfor j in range(n):\n\t(x, y) = (int(i) for i in input().rsplit())\n\tif x % y == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nt = int(input())\nfor _ in range(t):\n\t(a, b) = [int(x) for x in input().split()]\n\tsys.stdout.write('YES\\n' if a % b == 0 else 'NO\\n')\n", "n = int(input())\no = []\nfor i in range(n):\n\t(k, p) = [int(x) for x in input().split()]\n\tif k % p == 0:\n\t\to.append('YES')\n\telse:\n\t\to.append('NO')\nfor msg in o:\n\tprint(msg)\n", "from sys import stdin, stdout\nimport math\nimport heapq\nt = 1\n\ndef aint():\n\treturn int(input().strip())\n\ndef lint():\n\treturn list(map(int, input().split()))\n\ndef fint():\n\treturn list(map(int, stdin.readline().split()))\n\ndef main():\n\t(n, m) = lint()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nt = int(input())\nfor i in range(t):\n\tmain()\n", "import math\nt = int(input())\nfor p in range(t):\n\tval = list(map(int, input().split()))\n\tn = val[0]\n\tm = val[1]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for i in range(int(input())):\n\ta = list(map(int, input().split()))\n\tif a[0] % a[1] == 0:\n\t\tprint('YES')\n\t\tcontinue\n\tprint('NO')\n", "for hm in range(int(input())):\n\t(m, n) = map(int, input().split())\n\tif m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def solver(n, m):\n\tif n % m == 0:\n\t\treturn 'YES'\n\treturn 'NO'\nN = int(input())\nfor _ in range(N):\n\tnm = input().split(' ')\n\tn = int(nm[0])\n\tm = int(nm[1])\n\tprint(solver(n, m))\n", "T = int(input())\nfor t in range(T):\n\t(N, M) = list(map(int, input().split()))\n\tif N % M == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "exec(int(input()) * \"a,b=map(int,input().split());print('YNEOS'[a%b>0::2]);\")\n", "t = int(input())\nlista = []\nlistaELE = []\nfor x in range(t):\n\tlistaELE = list(map(int, input().split(' ')))\n\tif listaELE[0] % listaELE[1] == 0:\n\t\tlista.append('YES')\n\telse:\n\t\tlista.append('NO')\nfor i in range(len(lista)):\n\tprint(lista[i])\n", "n = int(input())\nwhile n:\n\tn -= 1\n\t(a, b) = [int(i) for i in input().split()]\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import os, sys, bisect, copy\nfrom collections import defaultdict, Counter, deque\nfrom functools import lru_cache\nif os.path.exists('in.txt'):\n\tsys.stdin = open('in.txt', 'r')\nif os.path.exists('out.txt'):\n\tsys.stdout = open('out.txt', 'w')\n\ndef input():\n\treturn sys.stdin.readline()\n\ndef mapi(arg=0):\n\treturn map(int if arg == 0 else str, input().split())\nfor _ in range(int(input())):\n\t(n, m) = mapi()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def main():\n\ttestCases = int(input(''))\n\tfor i in range(testCases):\n\t\t(n, m) = input('').split()\n\t\tm = int(m)\n\t\tn = int(n)\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "cases = int(input())\nfor i in range(cases):\n\tline = input().split(' ')\n\tn = int(line[0])\n\tm = int(line[1])\n\tif n % m == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "import math\nfrom sys import *\n\ndef solve():\n\t(n, k) = map(int, input().split())\n\tprint('YES' if n % k == 0 else 'NO')\nt = int(input())\nwhile t > 0:\n\tt -= 1\n\tsolve()\n", "import sys\ninput = sys.stdin.readline\nt = int(input())\nwhile t:\n\tt -= 1\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def I():\n\treturn list(map(int, input().split()))\nfor __ in range(int(input())):\n\t(n, m) = I()\n\tprint('NO') if n % m else print('YES')\n", "def solve(l):\n\tfor i in range(l):\n\t\t(m, n) = map(int, input().split())\n\t\tif m % n == 0:\n\t\t\tprint('Yes')\n\t\telse:\n\t\t\tprint('No')\nsolve(int(input()))\n", "import sys\nimport math\ninput = sys.stdin.readline\nt = int(input())\nfor _ in range(t):\n\t(n, m) = list(map(int, input().split()))\n\tif n % m:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "import math, sys\nfrom collections import defaultdict, Counter, deque\nINF = float('inf')\nMOD = 1000000007\n\ndef gcd(a, b):\n\twhile b:\n\t\t(a, b) = (b, a % b)\n\treturn a\n\ndef isPrime(n):\n\tif n <= 1:\n\t\treturn False\n\ti = 2\n\twhile i ** 2 <= n:\n\t\tif n % i == 0:\n\t\t\treturn False\n\t\ti += 1\n\treturn True\n\ndef primeFactors(n):\n\tfactors = []\n\ti = 2\n\twhile i ** 2 <= n:\n\t\twhile n % i == 0:\n\t\t\tfactors.append(i)\n\t\t\tn //= i\n\t\ti += 1\n\tif n > 1:\n\t\tfactors.append(n)\n\treturn factors\n\ndef vars():\n\treturn map(int, input().split())\n\ndef array():\n\treturn list(map(int, input().split()))\n\ndef main():\n\t(n, m) = vars()\n\tres = 'NO'\n\tif n % m == 0:\n\t\tres = 'YES'\n\tprint(res)\nt = int(input())\nfor _ in range(t):\n\tmain()\n", "T = int(input())\nfor _ in range(T):\n\t(m, n) = map(int, input().split())\n\tif m / n == int(m / n):\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import math\nimport sys\nimport itertools\nimport itertools\n\ndef sa(Type=int):\n\treturn [Type(x) for x in input().split()]\n\ndef solve(t):\n\t(n, m) = sa()\n\tprint('YES' if n % m == 0 else 'NO')\nt = int(input())\nfor i in range(t):\n\tsolve(i + 1)\n", "n = int(input())\nl = []\nfor i in range(n):\n\tm = list(map(int, input().split()))\n\tl.append(m)\nfor i in l:\n\tif i[0] % i[1] == 0:\n\t\tprint('yes')\n\telse:\n\t\tprint('No')\n", "from functools import reduce\nfrom itertools import combinations\nimport sys\n\nclass Read:\n\n\t@staticmethod\n\tdef string():\n\t\treturn input()\n\n\t@staticmethod\n\tdef int():\n\t\treturn int(input())\n\n\t@staticmethod\n\tdef list(delimiter=' '):\n\t\treturn input().split(delimiter)\n\n\t@staticmethod\n\tdef list_int(delimiter=' '):\n\t\treturn list(map(int, input().split(delimiter)))\n\ndef main():\n\tt = Read.int()\n\tfor _ in range(t):\n\t\t(n, m) = Read.list_int()\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "t = int(input())\nfor _ in range(t):\n\t(n, m) = map(int, input().split())\n\tif n > 5:\n\t\tif (n / m).is_integer():\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(a, b) = map(int, input().split())\n\tm = min(a, b)\n\tm2 = max(a, b)\n\tif m2 % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "R = lambda : list(map(int, input().split()))\nfor i in [0] * int(input()):\n\t(n, m) = R()\n\tprint('YES' if not n % m else 'NO')\n", "def solve(n, m):\n\tif n < m:\n\t\treturn 'NO'\n\tif n % m == 0:\n\t\treturn 'YES'\n\treturn 'NO'\nt = int(input())\nfor _ in range(t):\n\t(n, m) = map(int, input().split())\n\tr = solve(n, m)\n\tprint(r)\n", "t = int(input())\ncase = []\nfor i in range(t):\n\t(n, m) = input().split()\n\tn = int(n)\n\tm = int(m)\n\tif n % m == 0:\n\t\tcase.append(0)\n\telse:\n\t\tcase.append(1)\nfor i in range(t):\n\tif case[i] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for ctr in range(1, int(input()) + 1):\n\t(N, M) = map(int, input().split())\n\tif N % M == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nfrom collections import defaultdict\nimport math\nimport heapq\nt = int(sys.stdin.readline())\nfor _ in range(t):\n\t(n, m) = map(int, sys.stdin.readline().split())\n\t(a, b) = (max(n, m), min(n, m))\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\ta = input().split()\n\ta[0] = int(a[0])\n\ta[1] = int(a[1])\n\tif a[0] % a[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor i in range(n):\n\t(a, b) = map(int, input().split())\n\t(x, y) = (max(a, b), min(a, b))\n\tif x % y == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for i in range(int(input())):\n\t(y, z) = map(int, input().split())\n\tif y % z == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "def gcd(a, b):\n\treturn a % b == 0\nt = int(input())\nfor i in range(t):\n\t(a, b) = map(int, input().split())\n\tif gcd(a, b):\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def answer():\n\tn1 = int(input())\n\twhile n1:\n\t\ta = input().split()\n\t\tn = int(a[0])\n\t\tm = int(a[1])\n\t\tif n % m:\n\t\t\tprint('NO')\n\t\telse:\n\t\t\tprint('YES')\n\t\tn1 -= 1\nanswer()\n", "t = int(input())\na = []\nfor i in range(t):\n\t(p, s) = map(int, input().split())\n\ta.append([p, s])\nfor i in a:\n\tn = i[0]\n\tm = i[1]\n\tif m < 3:\n\t\tprint('NO')\n\telif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def R():\n\treturn map(int, input().split())\n\ndef I():\n\treturn int(input())\n\ndef S():\n\treturn str(input())\n\ndef L():\n\treturn list(R())\nfrom collections import Counter\nimport math\nimport sys\nfrom itertools import permutations\nimport bisect\nfor _ in range(I()):\n\t(n, m) = R()\n\tprint(['NO', 'YES'][n % m == 0])\n", "n = int(input())\nfor i in range(n):\n\t(m, k) = map(int, input().split())\n\tif m % k == 0 or k % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(big, small) = map(int, input().split())\n\tif big % small == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(f, g) = map(int, input().split())\n\td = f % g\n\tif d == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor i in range(n):\n\tarr = list(map(int, input().split()))\n\ta = arr[0]\n\tb = arr[1]\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "test = int(input())\nfor ij in range(test):\n\ta = list(map(int, input().split()))\n\tn = a[0]\n\tm = a[1]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def divisible(n, m):\n\treturn n // m * m == n\nx = int(input())\nfor i in range(x):\n\t(n, m) = input().split(' ')\n\tprint('YES' if divisible(int(n), int(m)) else 'NO')\n", "n = int(input())\nfor i in range(n):\n\tl = list(map(int, input().strip().split(' ')))\n\tif l[0] % l[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor i in range(n):\n\t(q, x) = map(int, input().split())\n\tif q % x:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "for _ in range(int(input())):\n\t(n, m) = (int(num) for num in input().split())\n\timpossible = n % m\n\tif impossible:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "x = int(input())\nm = []\nfor i in range(x):\n\ty = input()\n\tl = y.split(' ')\n\tfor u in range(2):\n\t\tl[u] = int(l[u])\n\tif l[0] % l[1] == 0:\n\t\tm.append('YES')\n\telse:\n\t\tm.append('NO')\nfor k in m:\n\tprint(k)\n", "t = int(input())\nfor i in range(t):\n\t(s1, s2) = map(int, input().split())\n\tif s1 % s2 == 0 and s1 > 5:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from math import ceil\ntest = int(input())\nfor _ in range(test):\n\t(n, m) = map(int, input().split())\n\tif ceil(n / m) != n // m:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "def main():\n\tT = int(input())\n\tfor _ in range(T):\n\t\t(N, M) = map(int, input().split())\n\t\tif N % M == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "def can_create(initial, desired):\n\treturn initial % desired == 0\ntests_number = int(input())\nfor _ in range(tests_number):\n\t(initial, desired) = map(int, input().split())\n\tresult = can_create(initial, desired)\n\tprint('YES' if result else 'NO')\n", "ans = []\nfor t in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tif n % m:\n\t\tans += ['NO']\n\telse:\n\t\tans += ['YES']\nprint('\\n'.join(ans))\n", "import sys\nf_in = sys.stdin\nt = int(f_in.readline())\nfor i in range(0, t):\n\tnumber = f_in.readline().split()\n\tn = int(number[0])\n\tm = int(number[1])\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "tc = int(input())\nfor ii in range(tc):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0 or m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from collections import Counter\nfrom collections import Counter\n\ndef solve():\n\t(a, b) = list(map(int, input().split()))\n\tif a % b:\n\t\treturn 'NO'\n\treturn 'YES'\nfor i in range(int(input())):\n\tprint(solve())\n", "import io\nimport os\nfrom collections import defaultdict, deque, Counter\n\ndef solve(N, M):\n\tif N % M == 0 or M % N == 0:\n\t\treturn 'YES'\n\treturn 'NO'\ninput = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline\nT = int(input())\nfor t in range(T):\n\t(N, M) = list(map(int, input().split()))\n\tans = solve(N, M)\n\tprint(ans)\n", "t = int(input())\nfor _ in range(t):\n\t(N, M) = map(int, input().split())\n\tif N % M == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def examA():\n\tT = I()\n\tans = []\n\tfor _ in range(T):\n\t\t(N, M) = LI()\n\t\tif N % M != 0:\n\t\t\tans.append('NO')\n\t\telse:\n\t\t\tans.append('YES')\n\tfor v in ans:\n\t\tprint(v)\n\treturn\n\ndef examB():\n\tans = 0\n\tprint(ans)\n\treturn\n\ndef examC():\n\tans = 0\n\tprint(ans)\n\treturn\n\ndef examD():\n\tans = 0\n\tprint(ans)\n\treturn\n\ndef examE():\n\tans = 0\n\tprint(ans)\n\treturn\n\ndef examF():\n\tans = 0\n\tprint(ans)\n\treturn\nimport sys, copy, bisect, itertools, heapq, math, random\nfrom heapq import heappop, heappush, heapify\nfrom collections import Counter, defaultdict, deque\n\ndef I():\n\treturn int(sys.stdin.readline())\n\ndef LI():\n\treturn list(map(int, sys.stdin.readline().split()))\n\ndef LSI():\n\treturn list(map(str, sys.stdin.readline().split()))\n\ndef LS():\n\treturn sys.stdin.readline().split()\n\ndef SI():\n\treturn sys.stdin.readline().strip()\nglobal mod, mod2, inf, alphabet, _ep\nmod = 10 ** 9 + 7\nmod2 = 998244353\ninf = 10 ** 18\n_ep = 10 ** (-12)\nalphabet = [chr(ord('a') + i) for i in range(26)]\nexamA()\n", "case = int(input())\nfor caseNum in range(0, case):\n\t(a, b) = [int(x) for x in input().split()]\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "k = int(input())\nfor l in range(k):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def main(n, m):\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nt = int(input())\na = [list(map(int, input().split())) for _ in range(t)]\nfor (n, m) in a:\n\tmain(n, m)\n", "import sys\nt = int(sys.stdin.readline())\nfor _ in range(t):\n\t(a, b) = [int(i) for i in sys.stdin.readline().split()]\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\ninput = sys.stdin.readline\nt = int(input())\nfor i in range(t):\n\t(m, n) = [int(x) for x in input().split()]\n\tif m % n == 0:\n\t\tprint('YES')\n\t\tcontinue\n\tprint('NO')\n", "t = int(input())\nwhile t:\n\tt -= 1\n\t(a, b) = [int(i) for i in input().split()]\n\tif a % b:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "for _ in range(int(input())):\n\t(n, k) = map(int, input().split())\n\tif n % k == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('NO')\n", "from collections import Counter, deque, defaultdict, OrderedDict, namedtuple\nfrom bisect import bisect_left, bisect_right, insort\nfrom math import sqrt, ceil, floor, factorial, gcd\nfrom sys import stdin\nt = int(stdin.readline())\nwhile t:\n\tt -= 1\n\t(n, m) = map(int, stdin.readline().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "nb_cases = int(input())\nfor case in range(nb_cases):\n\t(n, m) = [int(x) for x in input().split()]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "kl = int(input())\nfor l in range(kl):\n\t(n, m) = [int(i) for i in input().split()]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def jn(a, sep='\\n'):\n\treturn sep.join(map(str, a))\n\ndef solve(n, m):\n\tif n % m == 0:\n\t\treturn 'YES'\n\treturn 'NO'\n\ndef bruh():\n\ttests = int(input())\n\tans = [0] * tests\n\tfor test in range(tests):\n\t\t(n, m) = [int(i) for i in input().split()]\n\t\tans[test] = solve(n, m)\n\tprint(jn(ans))\nbruh()\n", "from sys import stdin, stdout\nfor _ in range(int(input())):\n\t(n, m) = map(int, stdin.readline().split())\n\tif n == m:\n\t\tprint('YES')\n\telif m > n:\n\t\tprint('NO')\n\telif n % m == 0 and m > 2:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\ni = 1\nwhile i <= t:\n\t(a, b) = input().split()\n\ta = int(a)\n\tb = int(b)\n\ti = i + 1\n\tif a % b == 0 and a > b and (b > 2):\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input(''))\nfor i in range(t):\n\t(n, k) = map(int, input('').split())\n\ts = []\n\tfor i in range(3, n):\n\t\tif n % i == 0:\n\t\t\ts.append(i)\n\tif k in s:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nimport math\nimport itertools\nimport functools\nimport collections\nimport operator\nimport fileinput\nimport copy\nORDA = 97\n\ndef ii():\n\treturn int(input())\n\ndef mi():\n\treturn map(int, input().split())\n\ndef li():\n\treturn list(map(int, input().split()))\n\ndef lcm(a, b):\n\treturn abs(a * b) // math.gcd(a, b)\n\ndef revn(n):\n\treturn str(n)[::-1]\n\ndef dd():\n\treturn collections.defaultdict(int)\n\ndef ddl():\n\treturn collections.defaultdict(list)\n\ndef sieve(n):\n\tif n < 2:\n\t\treturn list()\n\tprime = [True for _ in range(n + 1)]\n\tp = 3\n\twhile p * p <= n:\n\t\tif prime[p]:\n\t\t\tfor i in range(p * 2, n + 1, p):\n\t\t\t\tprime[i] = False\n\t\tp += 2\n\tr = [2]\n\tfor p in range(3, n + 1, 2):\n\t\tif prime[p]:\n\t\t\tr.append(p)\n\treturn r\n\ndef divs(n, start=1):\n\tr = []\n\tfor i in range(start, int(math.sqrt(n) + 1)):\n\t\tif n % i == 0:\n\t\t\tif n / i == i:\n\t\t\t\tr.append(i)\n\t\t\telse:\n\t\t\t\tr.extend([i, n // i])\n\treturn r\n\ndef divn(n, primes):\n\tdivs_number = 1\n\tfor i in primes:\n\t\tif n == 1:\n\t\t\treturn divs_number\n\t\tt = 1\n\t\twhile n % i == 0:\n\t\t\tt += 1\n\t\t\tn //= i\n\t\tdivs_number *= t\n\ndef prime(n):\n\tif n == 2:\n\t\treturn True\n\tif n % 2 == 0 or n <= 1:\n\t\treturn False\n\tsqr = int(math.sqrt(n)) + 1\n\tfor d in range(3, sqr, 2):\n\t\tif n % d == 0:\n\t\t\treturn False\n\treturn True\n\ndef convn(number, base):\n\tnewnumber = 0\n\twhile number > 0:\n\t\tnewnumber += number % base\n\t\tnumber //= base\n\treturn newnumber\n\ndef cdiv(n, k):\n\treturn n // k + (n % k != 0)\nfor _ in range(ii()):\n\t(n, m) = mi()\n\tprint('NO') if n % m else print('YES')\n", "import itertools\nimport math\nimport sys\nimport heapq\nfrom collections import Counter\nfrom collections import deque\nfrom fractions import gcd\nfrom functools import reduce\nsys.setrecursionlimit(4100000)\nINF = 1 << 60\nMOD = 10 ** 9 + 7\nt = int(input())\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def solve(n, m):\n\tif n % m == 0 or m % n == 0:\n\t\treturn 'YES'\n\treturn 'NO'\n\ndef main():\n\tt = int(input())\n\tfor _ in range(t):\n\t\t(n, m) = input().split()\n\t\tn = int(n)\n\t\tm = int(m)\n\t\tprint(solve(n, m))\nmain()\n", "result = [0] * 10001\nt = int(input())\nfor i in range(t):\n\ta = input().split()\n\tn = int(a[0])\n\tm = int(a[1])\n\tif n % m == 0:\n\t\tresult[i] = 1\nfor i in range(t):\n\tif result[i] == 1:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor u in range(t):\n\ttemp = list(map(int, input().rstrip().split()))\n\tm = temp[0]\n\tn = temp[1]\n\tif m % n == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "a = int(input())\nfor i in range(a):\n\t(x, y) = input().split()\n\tx = int(x)\n\ty = int(y)\n\tif x % y == 0:\n\t\tprint('YES')\n\tif x % y != 0:\n\t\tprint('NO')\n", "from sys import stdin, stdout\nn = int(stdin.readline())\na = []\nfor i in range(n):\n\ta.append([int(x) for x in stdin.readline().split()])\nfor j in range(n):\n\tif a[j][0] % a[j][1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor i in range(n):\n\t(ni, mi) = map(int, input().split())\n\tif ni % mi == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor i in range(n):\n\t(m, k) = map(int, input().split())\n\tif not m % k:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = input\ni = int\nfor f in range(i(n())):\n\tlis = n().split()\n\tk = i(lis[0]) / i(lis[-1])\n\tprint(['NO', 'YES'][i(k) == k])\n", "from math import *\nimport sys, random\n\ndef nextInt():\n\treturn int(input())\n\ndef nextStrs():\n\treturn input().split()\n\ndef nextInts():\n\treturn list(map(int, nextStrs()))\n\ndef main():\n\tt = nextInt()\n\twhile t > 0:\n\t\t(n, m) = nextInts()\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n\t\tt -= 1\nexit(main())\n", "length = int(input())\nfor i in range(length):\n\t(n, m) = [int(x) for x in input().split()]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input(''))\n\ndef test(l):\n\t(a, b) = (int(l[0]), int(l[1]))\n\tif a % b == 0:\n\t\treturn 'YES'\n\telse:\n\t\treturn 'NO'\nl = []\nfor i in range(t):\n\ts = input('').split(' ')\n\tc = test(s)\n\tl.append(c)\nfor j in range(len(l)):\n\tprint(l[j])\n", "t = int(input())\na = []\nfor i in range(t):\n\t(N, M) = map(int, input().split())\n\ta.append([N, M])\nfor i in a:\n\tn = i[0]\n\tm = i[1]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "A = []\nT = int(input())\nfor i in range(T):\n\tP = [int(x) for x in input().split()]\n\tA.append(P)\nfor X in A:\n\tprint('YES' if X[0] % X[1] == 0 else 'NO')\n", "def check(n, m):\n\tif n % m == 0:\n\t\treturn print('YES')\n\telse:\n\t\treturn print('NO')\nt = int(input())\nfor i in range(t):\n\t(n, m) = map(int, input().split())\n\tcheck(n, m)\n", "import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy\nsys.setrecursionlimit(10 ** 7)\ninf = 10 ** 20\nmod = 10 ** 9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\ndef LI():\n\treturn [int(x) for x in sys.stdin.readline().split()]\n\ndef I():\n\treturn int(sys.stdin.readline())\n\ndef F():\n\treturn float(sys.stdin.readline())\n\ndef LS():\n\treturn sys.stdin.readline().split()\n\ndef S():\n\treturn input()\n\ndef main():\n\tn = I()\n\tans = []\n\tfor _ in range(n):\n\t\t(a, b) = LI()\n\t\tif a % b == 0:\n\t\t\tans.append('YES')\n\t\telse:\n\t\t\tans.append('NO')\n\tfor x in ans:\n\t\tprint(x)\nmain()\n", "tests = int(input())\nn = []\nm = []\nfor i in range(0, tests):\n\ta = list(map(int, input().split()))\n\tn.append(a[0])\n\tm.append(a[1])\nfor i in range(0, tests):\n\tif m[i] == 2 or m[i] == 1:\n\t\tprint('NO')\n\telif n[i] % m[i] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nliste = []\nfor i in range(n):\n\t(a, b) = input().split(' ')\n\tliste.append((int(a), int(b)))\nfor (a, b) in liste:\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from collections import Counter\nfrom collections import defaultdict\nimport math\nimport random\nimport heapq as hq\nfrom math import sqrt\nimport sys\nfrom functools import reduce\n\ndef input():\n\treturn sys.stdin.readline().strip()\n\ndef iinput():\n\treturn int(input())\n\ndef tinput():\n\treturn input().split()\n\ndef rinput():\n\treturn map(int, tinput())\n\ndef rlinput():\n\treturn list(rinput())\nmod = int(1000000000.0) + 7\n\ndef factors(n):\n\treturn set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))\n\ndef solve(s, n, l, r, prefix, k):\n\tans = 0\n\tfor i in range(l, r + 1):\n\t\tfor j in range(i, r + 1):\n\t\t\tones = prefix[j] - prefix[i - 1]\n\t\t\tzeros = j - i - ones + 1\n\t\t\tif prefix[j] - prefix[i - 1] <= k and zeros <= k:\n\t\t\t\tans += 1\n\treturn ans\nfor _ in range(iinput()):\n\t(n, m) = rinput()\n\tprint('YES' if n % m == 0 else 'NO')\n", "import sys\n\ndef get_ints():\n\treturn map(int, sys.stdin.readline().strip().split())\nfor _ in range(int(input())):\n\t(n, m) = get_ints()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for i in range(int(input())):\n\t(n, m) = map(int, input().split(' '))\n\tif max(n, m) % min(m, n):\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "for i in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tprint('yes'.upper())\n\telse:\n\t\tprint('no'.upper())\n", "from math import gcd\nfor n in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tif a % b != 0:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "from collections import Counter\nfrom collections import defaultdict\nimport math\nt = int(input())\nfor _ in range(0, t):\n\t(n, m) = list(map(int, input().split()))\n\tf = 0\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor _ in range(t):\n\tf = False\n\t(n, m) = map(int, input().split())\n\tif n == 5 or n == 3 or n == 4:\n\t\tpass\n\telse:\n\t\tfor i in range(2, 100):\n\t\t\tif m * i == n:\n\t\t\t\tf = True\n\t\t\t\tbreak\n\tprint('NO' if f is False else 'YES')\n", "t = int(input())\nans_list = []\nfor i in range(t):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tans_list.append('YES')\n\telse:\n\t\tans_list.append('NO')\nfor i in range(t):\n\tprint(ans_list[i])\n", "import sys\nline = sys.stdin.read()\nt1 = line.split('\\n')\nt2 = [i.split() for i in t1]\nt = []\nfor i in t2:\n\tfor j in i:\n\t\tt.append(int(j))\nfor i in range(1, t[0] + 1):\n\ttestin = t[i * 2 - 1]\n\ttestout = t[i * 2]\n\tif testin % testout == 0 and testout >= 3:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "ans = ['YES', 'NO']\nfor t in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tprint(ans[min(n % m, 1)])\n", "x = 1\nx += 1\nx = 0\ny = x + 1\ny = 0\nfor tin in range(int(input())):\n\ti = 0\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nt = [list(map(int, input().split())) for x in range(n)]\nfor (x, y) in t:\n\tif x % y == 0:\n\t\tprint('yes')\n\telse:\n\t\tprint('no')\n", "w = int(input())\na = []\nfor i in range(0, w):\n\tp = input().split()\n\ta.append(p)\nfor i in range(0, w):\n\tr = a[i]\n\tif int(r[0]) % int(r[1]) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\tx = list(map(int, input().rstrip().split()))\n\tn = x[0]\n\tm = x[1]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nimport bisect\nimport heapq\nfrom math import *\nfrom collections import defaultdict as dd\nfrom collections import deque\nfrom collections import Counter as c\nfrom itertools import combinations as comb\nfrom bisect import bisect_left as bl, bisect_right as br, bisect\nmod = pow(10, 9) + 7\nmod2 = 998244353\n\ndef data():\n\treturn sys.stdin.readline().strip()\n\ndef out(var):\n\tsys.stdout.write(var)\n\ndef l():\n\treturn list(map(int, data().split()))\n\ndef sl():\n\treturn list(map(str, data().split()))\n\ndef sp():\n\treturn map(int, data().split())\n\ndef ssp():\n\treturn map(str, data().split())\n\ndef l1d(n, val=0):\n\treturn [val for i in range(n)]\n\ndef l2d(n, m, val=0):\n\treturn [[val for i in range(n)] for j in range(m)]\nfor _ in range(int(data())):\n\t(n, m) = sp()\n\tif n % m == 0:\n\t\tout('YES\\n')\n\telse:\n\t\tout('NO\\n')\n", "import sys\nimport math\nget_string = lambda : sys.stdin.readline().strip()\nget_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))\nget_int = lambda : int(sys.stdin.readline())\nfor _ in range(get_int()):\n\t(n, m) = get_int_list()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\n(input, print) = (sys.stdin.buffer.readline, sys.stdout.write)\nfor _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tif (n - m) % m == 0:\n\t\tprint('YES' + '\\n')\n\telse:\n\t\tprint('NO' + '\\n')\n", "from sys import stdin, stdout\ninp = stdin.readline\nsay = stdout.write\nfor t in range(int(inp().strip())):\n\t(n, m) = [int(_) for _ in inp().strip().split()]\n\tif n % m == 0:\n\t\tsay('YES\\n')\n\telse:\n\t\tsay('NO\\n')\n", "t = int(input())\nwhile t > 0:\n\tt = t - 1\n\tx = input()\n\tn = int(x.split(' ')[0])\n\tm = int(x.split(' ')[1])\n\tif n % m == 0 and n > 5:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nfrom bisect import bisect_left, bisect_right\nimport sys, itertools, math\nsys.setrecursionlimit(10 ** 5)\ninput = sys.stdin.readline\nsqrt = math.sqrt\n\ndef LI():\n\treturn list(map(int, input().split()))\n\ndef LF():\n\treturn list(map(float, input().split()))\n\ndef LI_():\n\treturn list(map(lambda x: int(x) - 1, input().split()))\n\ndef II():\n\treturn int(input())\n\ndef IF():\n\treturn float(input())\n\ndef S():\n\treturn input().rstrip()\n\ndef LS():\n\treturn S().split()\n\ndef IR(n):\n\tres = [None] * n\n\tfor i in range(n):\n\t\tres[i] = II()\n\treturn res\n\ndef LIR(n):\n\tres = [None] * n\n\tfor i in range(n):\n\t\tres[i] = LI()\n\treturn res\n\ndef FR(n):\n\tres = [None] * n\n\tfor i in range(n):\n\t\tres[i] = IF()\n\treturn res\n\ndef LIR(n):\n\tres = [None] * n\n\tfor i in range(n):\n\t\tres[i] = IF()\n\treturn res\n\ndef LIR_(n):\n\tres = [None] * n\n\tfor i in range(n):\n\t\tres[i] = LI_()\n\treturn res\n\ndef SR(n):\n\tres = [None] * n\n\tfor i in range(n):\n\t\tres[i] = S()\n\treturn res\n\ndef LSR(n):\n\tres = [None] * n\n\tfor i in range(n):\n\t\tres[i] = LS()\n\treturn res\nmod = 1000000007\ninf = float('INF')\n\ndef solve():\n\tt = II()\n\tfor i in range(t):\n\t\t(n, m) = LI()\n\t\tprint('YES' if n % m == 0 else 'NO')\n\treturn\nsolve()\n", "import sys\nfor line in sys.stdin.readlines()[1:]:\n\t(a, b) = map(int, line.split())\n\tprint('YES' if a % b == 0 else 'NO')\n", "import math\n\ndef solve():\n\t(n, m) = [int(x) for x in input().split(' ')]\n\tif n % m == 0:\n\t\tprint('YES')\n\t\treturn\n\tprint('NO')\n\treturn\nt = int(input())\nfor i in range(t):\n\tsolve()\n", "def main():\n\tt = int(input())\n\twhile t:\n\t\t(n, m) = map(int, input().split())\n\t\tif m > n:\n\t\t\tprint('NO')\n\t\telif n % m != 0:\n\t\t\tprint('NO')\n\t\telse:\n\t\t\tprint('YES')\n\t\tt -= 1\nmain()\n", "import sys, math, bisect\ninf = float('inf')\nmod = 10 ** 9 + 7\n\ndef lcm(a, b):\n\treturn int(a / math.gcd(a, b) * b)\n\ndef gcd(a, b):\n\treturn int(math.gcd(a, b))\n\ndef tobinary(n):\n\treturn bin(n)[2:]\n\ndef binarySearch(a, x):\n\ti = bisect.bisect_left(a, x)\n\tif i != len(a) and a[i] == x:\n\t\treturn i\n\telse:\n\t\treturn -1\n\ndef lowerBound(a, x):\n\ti = bisect.bisect_left(a, x)\n\tif i:\n\t\treturn i - 1\n\telse:\n\t\treturn -1\n\ndef upperBound(a, x):\n\ti = bisect.bisect_right(a, x)\n\tif i != len(a) + 1 and a[i - 1] == x:\n\t\treturn i - 1\n\telse:\n\t\treturn -1\n\ndef SieveOfEratosthenes(n):\n\tans = []\n\tprime = [True for i in range(n + 1)]\n\tp = 2\n\twhile p * p <= n:\n\t\tif prime[p] == True:\n\t\t\tfor i in range(p * p, n + 1, p):\n\t\t\t\tprime[i] = False\n\t\tp += 1\n\tfor p in range(2, n + 1):\n\t\tif prime[p]:\n\t\t\tans.append(p)\n\treturn ans\nfor _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tflag = True\n\tif n % m != 0:\n\t\tflag = False\n\tif flag:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor you in range(t):\n\tl = input().split()\n\tn = int(l[0])\n\tm = int(l[1])\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "testCases = int(input())\nfor i1 in range(testCases):\n\t(n, m) = list(map(int, input().split()))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for tc in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tif a % b:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "x = int(input())\nfor i in range(x):\n\tangulos = list(map(int, input().split()))\n\tif angulos[0] % angulos[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nimport math\nimport collections\nimport itertools\nINF = 10 ** 10\nMOD = 10 ** 9 + 7\n\ndef input():\n\treturn sys.stdin.readline().strip()\n\ndef gcd(x, y):\n\treturn y if x % y == 0 else gcd(y, x % y)\n\ndef lcm(x, y):\n\treturn x * y // gcd(x, y)\n\ndef I():\n\treturn int(input())\n\ndef LI():\n\treturn [int(x) for x in input().split()]\n\ndef RI(N):\n\treturn [int(input()) for _ in range(N)]\n\ndef LRI(N):\n\treturn [[int(x) for x in input().split()] for _ in range(N)]\nN = I()\nfor i in range(N):\n\t(N, M) = LI()\n\tprint('YES' if N % M == 0 else 'NO')\n", "from sys import stdin\n\ndef read():\n\treturn stdin.readline().strip()\nt = int(read())\nfor _ in range(t):\n\t(a, b) = map(int, read().split())\n\tprint(('NO', 'YES')[a % b == 0])\n", "import math\n\nclass Read:\n\n\t@staticmethod\n\tdef string():\n\t\treturn input()\n\n\t@staticmethod\n\tdef int():\n\t\treturn int(input())\n\n\t@staticmethod\n\tdef list(sep=' '):\n\t\treturn input().split(sep)\n\n\t@staticmethod\n\tdef list_int(sep=' '):\n\t\treturn list(map(int, input().split(sep)))\n\ndef solve():\n\t(n, m) = Read.list_int()\n\tprint('YES' if n % m == 0 else 'NO')\nquery_count = Read.int()\nwhile query_count:\n\tquery_count -= 1\n\tsolve()\n", "a = int(input())\nfor i in range(a):\n\tside_input = [int(side) for side in input().split()]\n\tif side_input[0] % side_input[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for i in range(int(input())):\n\tnm = input().split()\n\tn = int(nm[0])\n\tm = int(nm[1])\n\tif max(n, m) % min(n, m) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nans = ['YES', 'NO']\nfor i in range(t):\n\tdiv = 1\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tdiv = 0\n\tprint(ans[div])\n", "a = int(input())\nfor i in range(a):\n\t(fig1, fig2) = map(int, input().split())\n\tif fig1 >= fig2 and fig1 % fig2 == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\ninput = sys.stdin.readline\nfor ti in range(int(input())):\n\t(n, m) = [int(x) for x in input().strip().split()]\n\tprint('YES') if not n % m else print('NO')\n", "from sys import stdin\ninput()\nfor line in stdin:\n\t(n, m) = map(int, line.split())\n\tprint('YES' if n % m == 0 else 'NO')\n", "for x in range(int(input())):\n\t(h, m) = list(map(int, input().split()))\n\tif h % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(a, b) = map(int, input().split())\n\tif a % b:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "t = int(input())\nfor v in range(t):\n\t(a, b) = map(int, input().split())\n\tm = max(a, b)\n\tn = min(a, b)\n\tif m % n == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nans = []\nfor _ in range(n):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tans.append('YES')\n\telse:\n\t\tans.append('NO')\nprint(*ans, sep='\\n')\n", "import sys\ninput = sys.stdin.readline\nQ = int(input())\nQuery = [list(map(int, input().split())) for _ in range(Q)]\nfor (N, M) in Query:\n\tprint('YES' if N % M == 0 else 'NO')\n", "t = int(input())\nfor i in range(t):\n\t(p, q) = input().split(' ')\n\tp = int(p)\n\tq = int(q)\n\ts = p % q\n\tif s == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def gcd(x, y):\n\tif y == 0:\n\t\treturn x\n\telse:\n\t\treturn gcd(y, x % y)\nt = int(input())\nfor _ in range(t):\n\t(u, v) = map(int, input().split())\n\tif u > v:\n\t\tif u % v == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n\telif v % u == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "while True:\n\ttry:\n\t\tt = eval(input())\n\t\tfor i in range(t):\n\t\t\t(n, m) = map(int, input().split())\n\t\t\tif n % m == 0:\n\t\t\t\tprint('YES')\n\t\t\telse:\n\t\t\t\tprint('NO')\n\texcept:\n\t\tbreak\n", "import sys\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nfor _ in range(int(input())):\n\t(n, m) = [int(x) for x in input().split()]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "N = int(input())\nanswers = []\nstroka = []\nfor i in range(N):\n\tstroka = input().split()\n\tif int(stroka[0]) % int(stroka[1]) == 0:\n\t\tanswers.append('YES')\n\telse:\n\t\tanswers.append('NO')\nfor i in range(len(answers)):\n\tprint(answers[i])\n", "import sys\ninput = sys.stdin.readline\n\ndef inp():\n\treturn input()\ncount = int(inp())\nfor line in range(count):\n\tcontent = inp()\n\tn = int(content.split()[0])\n\tm = int(content.split()[1])\n\tresult = 'YES' if n % m == 0 else 'NO'\n\tprint(result)\n", "for _ in range(int(input())):\n\tprint('YNEOS'[bool(divmod(*map(int, input().split()))[1])::2])\n", "import math\nimport collections\nimport bisect\n\ndef arrPrint(a):\n\treturn ' '.join([str(i) for i in a])\n\ndef gridPrint(a):\n\treturn '\\n'.join([' '.join([str(j) for j in a[i]]) for i in range(len(a))])\n\ndef isPalindrome(s):\n\tfor i in range(len(s) // 2):\n\t\tif not s[i] == s[-i - 1]:\n\t\t\treturn False\n\treturn True\n\ndef primeCheck(n):\n\tfor i in range(2, int(math.sqrt(n)) + 1):\n\t\tif n % i == 0:\n\t\t\treturn False\n\treturn True\n\ndef solve(n, m):\n\tif n // m > 1 and n % m == 0:\n\t\treturn 'YES'\n\treturn 'NO'\nt = int(input())\nfor _ in range(t):\n\t(n, m) = list(map(int, input().split()))\n\tresult = solve(n, m)\n\tprint(result)\n", "t = int(input())\nres = ''\nfor i in range(t):\n\t(n, m) = input().split()\n\tn = int(n)\n\tm = int(m)\n\tif n % m == 0:\n\t\tres += 'YES'\n\telse:\n\t\tres += 'NO'\n\tres += '\\n'\nprint(res, end='')\n", "t = int(input())\nwhile t > 0:\n\t(side1, side2) = [int(x) for x in input().split()]\n\tif side1 % side2 == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tt = t - 1\n", "n = int(input())\nresults = []\nwhile n > 0:\n\tintake = str(input()).split(' ')\n\tfirstNum = int(intake[0])\n\tsecondNum = int(intake[1])\n\tif firstNum % secondNum == 0:\n\t\tresults.append('YES')\n\telif secondNum > firstNum:\n\t\tresults.append('NO')\n\telse:\n\t\tresults.append('NO')\n\tn -= 1\nfor element in results:\n\tprint(element)\n", "def solve(n, m):\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\ndef main():\n\tt = int(input())\n\twhile t != 0:\n\t\tnm = input().split()\n\t\tsolve(int(nm[0]), int(nm[1]))\n\t\tt -= 1\nmain()\n", "def solve():\n\t(a, b) = map(int, input().split())\n\tif a % b:\n\t\tprint('No')\n\telse:\n\t\tprint('Yes')\nt = int(input())\nfor _ in range(t):\n\tsolve()\n", "t = int(input())\nfor ooo in range(t):\n\t(n, m) = [int(aaa) for aaa in input().split()]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def solve():\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nt = eval(input())\nwhile t:\n\tsolve()\n\tt -= 1\n", "c = int(input())\nfor _ in range(c):\n\t(n, m) = map(int, input().split())\n\t(d, f) = (max(n, m), min(n, m))\n\tif d % f == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from math import *\n\ndef binarySearch(arr, x, i):\n\tl = i\n\tr = len(arr) - 1\n\twhile l <= r:\n\t\tmid = (l + r) // 2\n\t\tif arr[mid] == x:\n\t\t\treturn mid\n\t\telif arr[mid] < x:\n\t\t\tl = mid + 1\n\t\telse:\n\t\t\tr = mid - 1\n\treturn -1\n\ndef js(arr, x):\n\tl = 0\n\tr = len(arr) - 1\n\tans = -1\n\twhile l <= r:\n\t\tm = (l + r) // 2\n\t\tif arr[m] <= x:\n\t\t\tans = m\n\t\t\tl = m + 1\n\t\telse:\n\t\t\tr = m - 1\n\treturn ans\n\ndef jg(arr, x):\n\tl = 0\n\tr = len(arr) - 1\n\tans = -1\n\twhile l <= r:\n\t\tm = (l + r) // 2\n\t\tif arr[m] >= x:\n\t\t\tans = m\n\t\t\tr = m - 1\n\t\telse:\n\t\t\tl = m + 1\n\treturn ans\nfor __ in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\ninput = sys.stdin.readline\n\ndef getInt():\n\treturn int(input())\n\ndef getVars():\n\treturn map(int, input().split())\n\ndef getList():\n\treturn list(map(int, input().split()))\n\ndef getStr():\n\treturn input().strip()\nt = getInt()\nfor _ in range(t):\n\t(n, m) = getVars()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from math import *\nfrom sys import *\nt = int(stdin.readline())\nfor i in range(t):\n\t(n, k) = map(int, stdin.readline().split())\n\tif n % k == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "k = int(input())\nfor i in range(k):\n\ta = list(map(int, input().split()))\n\tif a[0] % a[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "import math\nt = int(input(''))\nwhile t > 0:\n\t(n, m) = input('').split()\n\tn = int(n)\n\tm = int(m)\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tt = t - 1\n", "def convex(n, y):\n\treturn n % y == 0\nt = int(input())\nfor i in range(t):\n\t(x, p) = input().split()\n\tif convex(int(x), int(p)):\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def get(*arg):\n\tif arg[0] == 0:\n\t\tcnt = int(input())\n\t\tflag = 1\n\telse:\n\t\tcnt = 1\n\t\tflag = 0\n\tlst = list()\n\tfor i in range(cnt):\n\t\tlst2 = list()\n\t\tfor ii in range(len(arg) - flag):\n\t\t\tif arg[ii + flag] == 1:\n\t\t\t\tt = input().split()\n\t\t\t\ttmp = list()\n\t\t\t\tfor iii in t:\n\t\t\t\t\ttmp.append(int(iii))\n\t\t\telif arg[ii + flag] == 2:\n\t\t\t\ttmp = input().split()\n\t\t\telse:\n\t\t\t\ttmp = input()\n\t\t\tlst2.append(tmp)\n\t\tlst.append(lst2)\n\treturn lst\na = get(0, 1)\nfor i in a:\n\tif i[0][0] % i[0][1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor kase in range(t):\n\t(n, m) = tuple(map(int, input().split(' ')))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\ninput = sys.stdin.readline\n\ndef make_divisors(n):\n\tdivisors = []\n\tfor i in range(1, int(n ** 0.5) + 1):\n\t\tif n % i == 0:\n\t\t\tdivisors.append(i)\n\t\t\tif i != n // i:\n\t\t\t\tdivisors.append(n // i)\n\treturn divisors\n\ndef main():\n\tt = int(input())\n\tfor _ in range(t):\n\t\t(N, M) = [int(x) for x in input().split()]\n\t\tdivs = set(make_divisors(N))\n\t\tif M in divs:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "t = int(input())\na = []\nb = []\nfor i in range(t):\n\t(n, m) = [int(n) for n in input().split()]\n\ta.append(n)\n\tb.append(m)\nfor j in range(t):\n\tif a[j] % b[j] == 0:\n\t\tprint('Yes')\n\telse:\n\t\tprint('No')\n", "from sys import stdin, stdout\nt = int(stdin.readline())\nfor _ in range(t):\n\t(n, m) = [int(i) for i in stdin.readline().split()]\n\tif n % m == 0:\n\t\tstdout.write('YES\\n')\n\telse:\n\t\tstdout.write('NO\\n')\n", "t = int(input())\nfor i in range(t):\n\t(a, b) = map(int, input().split(' '))\n\tif a >= 3 and b >= 3:\n\t\tif a % b == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\n", "import sys\nimport os\nimport time\nimport collections\nfrom collections import Counter, deque\nimport itertools\nimport math\nimport timeit\nimport random\nfrom io import BytesIO, IOBase\nfrom bisect import bisect_left as bl\nfrom bisect import bisect_right as br\n\ndef sieve(n):\n\tif n < 2:\n\t\treturn list()\n\tprime = [True for _ in range(n + 1)]\n\tp = 3\n\twhile p * p <= n:\n\t\tif prime[p]:\n\t\t\tfor i in range(p * 2, n + 1, p):\n\t\t\t\tprime[i] = False\n\t\tp += 2\n\tr = [2]\n\tfor p in range(3, n + 1, 2):\n\t\tif prime[p]:\n\t\t\tr.append(p)\n\treturn r\n\ndef divs(n, start=1):\n\tdivisors = []\n\tfor i in range(start, int(math.sqrt(n) + 1)):\n\t\tif n % i == 0:\n\t\t\tif n / i == i:\n\t\t\t\tdivisors.append(i)\n\t\t\telse:\n\t\t\t\tdivisors.extend([i, n // i])\n\treturn divisors\n\ndef divn(n, primes):\n\tdivs_number = 1\n\tfor i in primes:\n\t\tif n == 1:\n\t\t\treturn divs_number\n\t\tt = 1\n\t\twhile n % i == 0:\n\t\t\tt += 1\n\t\t\tn //= i\n\t\tdivs_number *= t\n\ndef flin(d, x, default=-1):\n\tleft = right = -1\n\tfor i in range(len(d)):\n\t\tif d[i] == x:\n\t\t\tif left == -1:\n\t\t\t\tleft = i\n\t\t\tright = i\n\tif left == -1:\n\t\treturn (default, default)\n\telse:\n\t\treturn (left, right)\n\ndef modpow(b, p, m):\n\tres = 1\n\tb = b % m\n\twhile p:\n\t\tif p & 1:\n\t\t\tres = res * b % m\n\t\tb = b * b % m\n\t\tp >>= 1\n\treturn res\n\ndef mod_inv(a, m):\n\treturn modpow(a, m - 2, m)\n\ndef ncr(n, r, m):\n\tres = 1\n\tif r == 0:\n\t\treturn 1\n\tif n - r < r:\n\t\tr = n - r\n\t(p, k) = (1, 1)\n\twhile r:\n\t\tres = res % m * (n % m * mod_inv(r, m) % m) % m\n\t\tn -= 1\n\t\tr -= 1\n\treturn res\n\ndef ncrlis(n, r, m, fact):\n\treturn fact[n] * (mod_inv(fact[r], m) * mod_inv(fact[n - r], m)) % m % m\n\ndef ceil(n, k):\n\treturn n // k + (n % k != 0)\n\ndef ii():\n\treturn int(input())\n\ndef mi():\n\treturn map(int, input().split())\n\ndef li():\n\treturn list(map(int, input().split()))\n\ndef lcm(a, b):\n\treturn abs(a * b) // math.gcd(a, b)\n\ndef prr(a, sep=' '):\n\tprint(sep.join(map(str, a)))\n\ndef dd():\n\treturn collections.defaultdict(int)\n\ndef ddl():\n\treturn collections.defaultdict(list)\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nfor _ in range(ii()):\n\t(n, m) = mi()\n\tprint('YES' if n % m == 0 else 'NO')\n", "n = int(input())\nfor i in range(n):\n\t(n1, k) = map(int, input().split())\n\tif k <= 2:\n\t\tprint('NO')\n\telif n1 % k == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nfrom sys import stdout, stdin\nimport math\n\ndef inputt():\n\treturn stdin.readline().strip()\n\ndef iinput():\n\treturn int(input())\n\ndef rinput():\n\treturn input().split()\n\ndef rlinput():\n\treturn [int(i) for i in input().split()]\n\ndef main():\n\t(n, m) = rlinput()\n\tif n % m == 0 and n > m:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nfor i in range(iinput()):\n\tmain()\n", "t = int(input())\nfor _ in range(t):\n\t(n, m) = map(int, input().split())\n\tf = False\n\tfor x in range(2, 100):\n\t\tif x * m == n:\n\t\t\tf = True\n\t\t\tbreak\n\tprint('YES') if f else print('NO')\n", "t = int(input())\nt1 = t\nnn = []\nmn = []\nwhile t != 0:\n\t(n, m) = list(map(int, input().split(' ')))\n\tnn.append(n)\n\tmn.append(m)\n\tt -= 1\nfor i in range(t1):\n\tif nn[i] % mn[i] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def solution(m, n):\n\tif n % m == 0:\n\t\treturn 'YES'\n\telse:\n\t\treturn 'NO'\nt = int(input())\nwhile t > 0:\n\t(n, m) = [int(x) for x in input().split()]\n\tS = solution(m, n)\n\tprint(S)\n\tt -= 1\n", "import sys\nfirst = 1\nfrom math import gcd\nfor line in sys.stdin:\n\tvalues = list(map(int, line.split()))\n\tif first == 1:\n\t\tfirst = 0\n\t\tcontinue\n\t(a, b) = values\n\tg = gcd(a, b)\n\tif g == min(a, b):\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def rint():\n\treturn int(input())\n\ndef rlint():\n\treturn [int(i) for i in input().split()]\nt = rint()\nfor _ in range(t):\n\t(n, m) = rlint()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor _ in range(n):\n\t(a, b) = tuple(input().split(' '))\n\t(a, b) = (int(a), int(b))\n\t(a, b) = (max(a, b), min(a, b))\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def prim(a, b):\n\twhile b != 0:\n\t\tc = a % b\n\t\ta = b\n\t\tb = c\n\treturn a\nn = int(input())\nfor i in range(n):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def solve(n, m):\n\treturn 'YES' if not n % m else 'NO'\n\ndef main():\n\tinp = lambda : [int(x) for x in input().split()]\n\ttc = int(input())\n\tfor _ in range(tc):\n\t\t(n, m) = inp()\n\t\tprint(solve(n, m))\nmain()\n", "t = int(input())\nfor i in range(t):\n\ta = list(map(int, input().split(' ')))\n\tprint(('NO', 'YES')[a[0] % a[1] == 0 or a[1] % a[0] == 0])\n", "import math\nn = int(input())\nfor t in range(n):\n\ta = list(map(int, input().split()))\n\tif a[0] % a[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\ns = []\nfor hfvjv in range(0, t):\n\tx = input()\n\txx = x.split()\n\tn = int(xx[0])\n\tm = int(xx[1])\n\tif n % m == 0:\n\t\ts.append('YES')\n\telse:\n\t\ts.append('NO')\nfor i in s:\n\tprint(i)\n", "for _ in [0] * int(input()):\n\t(n, m) = map(int, input().split())\n\tprint('YNEOS'[n % m > 0::2])\n", "t = int(input())\nn_list = []\nm_list = []\nfor i in range(1, t + 1):\n\t(n, m) = (int(value) for value in input().split())\n\tn_list.append(n)\n\tm_list.append(m)\nfor index in range(t):\n\tif n_list[index] % m_list[index] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor i in range(t):\n\t(N, M) = [int(x) for x in input().split()]\n\tprint('YES' if N % M == 0 else 'NO')\n", "def solve():\n\tT = int(input())\n\tfor i in range(T):\n\t\t(n, m) = map(int, input().split())\n\t\tif n % m:\n\t\t\tprint('NO')\n\t\telse:\n\t\t\tprint('YES')\nsolve()\n", "import sys\nimport math\nimport bisect\n\ndef main():\n\tfor _ in range(int(input())):\n\t\t(n, m) = map(int, input().split())\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nmain()\n", "for _ in range(int(input())):\n\t(n, mm) = map(int, input().split())\n\tprint(('YES', 'NO')[n % mm > 0])\n", "def solved(n, m):\n\tif n % m == 0:\n\t\treturn 'YES'\n\treturn 'NO'\nn = int(input())\nwhile n > 0:\n\t(x, y) = map(int, input().split())\n\tprint(solved(x, y))\n\tn -= 1\n", "import sys\nT = int(sys.stdin.readline())\nfor i in range(T):\n\t(a, b) = map(int, sys.stdin.readline().split())\n\tif max(a, b) % min(a, b) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "I = input\nx = {True: 'YES', False: 'NO'}\nfor _ in range(int(I())):\n\t(a, b) = list(map(int, I().split()))\n\tprint(x[a % b == 0])\n", "for ioi in range(int(input())):\n\t(nn, m) = map(int, input().split())\n\tif nn % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from sys import stdin\n\ndef main():\n\tt = int(stdin.readline().strip())\n\tfor _ in range(t):\n\t\t(n, m) = map(int, stdin.readline().strip().split())\n\t\tprint('YES' if n % m == 0 else 'NO')\nmain()\n", "for t in range(int(input())):\n\t(l, m) = map(int, input().split())\n\tif l % m == 0 and m >= 3:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor i in range(1, n + 1):\n\t(a, b) = [int(x) for x in input().split(' ')]\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "l = int(input())\nfor i in range(l):\n\t(x, y) = input().split()\n\tx = int(x)\n\ty = int(y)\n\tif x % y == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for i in range(int(input())):\n\t(x, y) = map(int, input().split())\n\tif y < 3 or x % y:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\n", "T = int(input())\nwhile T > 0:\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('No')\n\tT -= 1\n", "test_case = int(input())\ni = 0\nwhile i < test_case:\n\ti += 1\n\t(a, b) = input().split()\n\tif int(a) % int(b) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for i in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tif (m - 2) * 180 / m >= 180:\n\t\tprint('NO')\n\t\tcontinue\n\tif n % m != 0:\n\t\tprint('NO')\n\t\tcontinue\n\tprint('YES')\n", "t = int(input())\nfor i in range(t):\n\tn = input().split()\n\t(n[0], n[1]) = (int(n[0]), int(n[1]))\n\tif n[0] % n[1] == 0:\n\t\tprint('YES')\n\t\tcontinue\n\tprint('NO')\n", "from math import gcd\nt = int(input())\nfor tt in range(t):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0 or b % a == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\n\ndef input():\n\treturn sys.stdin.readline().rstrip('\\r\\n')\nfor case in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "test_cases = int(input())\nfor cases in range(test_cases):\n\t(n, m) = input().split(' ')\n\t(n, m) = (int(n), int(m))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "num = int(input())\nfor i in range(num):\n\tside = input()\n\tside = side.split(' ')\n\ta = int(side[0])\n\tb = int(side[1])\n\tif a % b == 0 or b % a == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "num_tests = int(input())\ntests = []\nfor i in range(num_tests):\n\ttests.append(input().split(' '))\nfor test in tests:\n\tprint('YES') if int(test[0]) % int(test[1]) == 0 else print('NO')\n", "t = int(input())\n\ndef solve(ta, tb):\n\tif ta % tb == 0:\n\t\treturn 1\n\telse:\n\t\treturn 0\nans = []\nfor _ in range(t):\n\t(ta, tb) = map(int, input().split())\n\tans.append(solve(ta, tb))\nfor a in ans:\n\tif a:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from sys import stdin\n\ndef main():\n\tr = stdin.readline\n\tcases = int(r())\n\tfor case in range(cases):\n\t\t(a, b) = map(int, r().strip().split())\n\t\tprint('NO' if a % b != 0 else 'YES')\nmain()\n", "n = int(input())\nfor i in range(n):\n\ta = list(map(int, input().strip().split()))\n\tc = 0\n\tfor i in range(1, a[0]):\n\t\tif a[0] == i * a[1]:\n\t\t\tc += 1\n\tif c == 0:\n\t\tprint('NO')\n\tif c >= 1:\n\t\tprint('YES')\n", "tests = [[int(i) for i in input().split()] for j in range(int(input()))]\nfor test in tests:\n\tprint('YES' if test[0] % test[1] == 0 else 'NO')\n", "import math\nimport itertools\ngh = lambda : map(int, input().split())\nN = 2 * 10000000.0 + 5\nN = int(N)\n\ndef main():\n\tt = int(input())\n\twhile t:\n\t\tt -= 1\n\t\t(n, m) = gh()\n\t\tprint('YNEOS'[n % m != 0::2])\nmain()\n", "import math, collections, sys\ninput = sys.stdin.readline\n\ndef solve():\n\t(n, m) = map(int, input().split())\n\tif n % m:\n\t\tprint('NO')\n\telse:\n\t\tprint('YES')\nfor _ in range(int(input())):\n\tsolve()\n", "from __future__ import division, print_function\nimport os, sys\nfrom io import BytesIO, IOBase\nif sys.version_info[0] < 3:\n\tfrom __builtin__ import xrange as range\n\tfrom future_builtins import ascii, filter, hex, map, oct, zip\n\ndef ii():\n\treturn int(input())\n\ndef si():\n\treturn input()\n\ndef mi():\n\treturn map(int, input().strip().split(' '))\n\ndef msi():\n\treturn map(str, input().strip().split(' '))\n\ndef li():\n\treturn list(mi())\n\ndef dmain():\n\tsys.setrecursionlimit(1000000)\n\tthreading.stack_size(1024000)\n\tthread = threading.Thread(target=main)\n\tthread.start()\nimport sys\ninput = sys.stdin.readline\nscanner = lambda : int(input())\nstring = lambda : input().rstrip()\nget_list = lambda : list(read())\nread = lambda : map(int, input().split())\nget_float = lambda : map(float, input().split())\n\ndef ceil(x):\n\tif x != int(x):\n\t\tx = int(x) + 1\n\treturn x\n\ndef factorial(x, m):\n\tval = 1\n\twhile x > 0:\n\t\tval = val * x % m\n\t\tx -= 1\n\treturn val\n\ndef fact(x):\n\tval = 1\n\twhile x > 0:\n\t\tval *= x\n\t\tx -= 1\n\treturn val\n\ndef swaparr(arr, a, b):\n\ttemp = arr[a]\n\tarr[a] = arr[b]\n\tarr[b] = temp\n\ndef gcd(a, b):\n\tif b == 0:\n\t\treturn a\n\treturn gcd(b, a % b)\n\ndef lcm(a, b):\n\treturn a * b // math.gcd(a, b)\n\ndef is_integer(n):\n\treturn math.ceil(n) == math.floor(n)\n\ndef nCr(n, k):\n\tif k > n:\n\t\treturn 0\n\tif k > n - k:\n\t\tk = n - k\n\tres = 1\n\tfor i in range(k):\n\t\tres = res * (n - i)\n\t\tres = res / (i + 1)\n\treturn int(res)\n\ndef primefs(n):\n\tprimes = {}\n\twhile n % 2 == 0 and n > 0:\n\t\tprimes[2] = primes.get(2, 0) + 1\n\t\tn = n // 2\n\tfor i in range(3, int(n ** 0.5) + 2, 2):\n\t\twhile n % i == 0 and n > 0:\n\t\t\tprimes[i] = primes.get(i, 0) + 1\n\t\t\tn = n // i\n\tif n > 2:\n\t\tprimes[n] = primes.get(n, 0) + 1\n\treturn primes\n\ndef power(x, y, p):\n\tres = 1\n\tx = x % p\n\tif x == 0:\n\t\treturn 0\n\twhile y > 0:\n\t\tif y & 1 == 1:\n\t\t\tres = res * x % p\n\t\ty = y >> 1\n\t\tx = x * x % p\n\treturn res\n\ndef swap(a, b):\n\ttemp = a\n\ta = b\n\tb = temp\n\treturn (a, b)\n\ndef find(x, link):\n\tp = x\n\twhile p != link[p]:\n\t\tp = link[p]\n\twhile x != p:\n\t\tnex = link[x]\n\t\tlink[x] = p\n\t\tx = nex\n\treturn p\n\ndef union(x, y, link, size):\n\tx = find(x, link)\n\ty = find(y, link)\n\tif size[x] < size[y]:\n\t\t(x, y) = swap(x, y)\n\tif x != y:\n\t\tsize[x] += size[y]\n\t\tlink[y] = x\n\ndef sieve(n):\n\tprime = [True for i in range(n + 1)]\n\t(prime[0], prime[1]) = (False, False)\n\tp = 2\n\twhile p * p <= n:\n\t\tif prime[p] == True:\n\t\t\tfor i in range(p * p, n + 1, p):\n\t\t\t\tprime[i] = False\n\t\tp += 1\n\treturn prime\n\ndef phi(n):\n\tresult = n\n\tp = 2\n\twhile p * p <= n:\n\t\tif n % p == 0:\n\t\t\twhile n % p == 0:\n\t\t\t\tn = n // p\n\t\t\tresult = result * (1.0 - 1.0 / float(p))\n\t\tp = p + 1\n\tif n > 1:\n\t\tresult = result * (1.0 - 1.0 / float(n))\n\treturn int(result)\n\ndef is_prime(n):\n\tif n == 0:\n\t\treturn False\n\tif n == 1:\n\t\treturn True\n\tfor i in range(2, int(n ** (1 / 2)) + 1):\n\t\tif not n % i:\n\t\t\treturn False\n\treturn True\n\ndef next_prime(n, primes):\n\twhile primes[n] != True:\n\t\tn += 1\n\treturn n\nMAXN = int(100000.0 + 5)\n\ndef spf_sieve():\n\tspf[1] = 1\n\tfor i in range(2, MAXN):\n\t\tspf[i] = i\n\tfor i in range(4, MAXN, 2):\n\t\tspf[i] = 2\n\tfor i in range(3, ceil(MAXN ** 0.5), 2):\n\t\tif spf[i] == i:\n\t\t\tfor j in range(i * i, MAXN, i):\n\t\t\t\tif spf[j] == j:\n\t\t\t\t\tspf[j] = i\nspf = [0 for i in range(MAXN)]\n\ndef factoriazation(x):\n\tres = []\n\tfor i in range(2, int(x ** 0.5) + 1):\n\t\twhile x % i == 0:\n\t\t\tres.append(i)\n\t\t\tx //= i\n\tif x != 1:\n\t\tres.append(x)\n\treturn res\n\ndef factors(n):\n\tres = []\n\tfor i in range(1, int(n ** 0.5) + 1):\n\t\tif n % i == 0:\n\t\t\tres.append(i)\n\t\t\tres.append(n // i)\n\treturn list(set(res))\n\ndef int_array():\n\treturn list(map(int, input().strip().split()))\n\ndef float_array():\n\treturn list(map(float, input().strip().split()))\n\ndef str_array():\n\treturn input().strip().split()\n\ndef binary_search(low, high, w, h, n):\n\twhile low < high:\n\t\tmid = low + (high - low) // 2\n\t\tif check(mid, w, h, n):\n\t\t\tlow = mid + 1\n\t\telse:\n\t\t\thigh = mid\n\treturn low\n\ndef check(moves, n):\n\tval = (moves + 1) // 2\n\trem = moves - val\n\tsol = (val + 1) * (rem + 1)\n\treturn sol < n\n\ndef sortSecond(val):\n\treturn val[1]\nMOD = int(1000000000.0) + 7\nCMOD = 998244353\nINF = float('inf')\nNINF = -float('inf')\nalphs = 'abcdefghijklmnopqrstuvwxyz'\nfrom itertools import permutations\nimport math\nimport bisect as bis\nimport random\nimport sys\nimport collections as collect\nimport functools as fnt\nfrom decimal import Decimal\n\ndef solve():\n\t(n, m) = read()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n\ndef print(*args, **kwargs):\n\t(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))\n\tat_start = True\n\tfor x in args:\n\t\tif not at_start:\n\t\t\tfile.write(sep)\n\t\tfile.write(str(x))\n\t\tat_start = False\n\tfile.write(kwargs.pop('end', '\\n'))\n\tif kwargs.pop('flush', False):\n\t\tfile.flush()\nif sys.version_info[0] < 3:\n\t(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))\nelse:\n\t(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nt = scanner()\nfor i in range(t):\n\tsolve()\n", "n = int(input())\narr = []\nfor i in range(n):\n\tarr.append([int(i) for i in input().split()])\nfor i in arr:\n\tif i[0] % i[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nt = int(sys.stdin.readline())\nfor i in range(t):\n\tnm = sys.stdin.readline().split()\n\tif int(nm[0]) % int(nm[1]) == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "for _ in range(int(input())):\n\tl = [int(x) for x in input().split()]\n\tn1 = l[0]\n\tn2 = l[1]\n\tif n1 % n2 == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\nfrom collections import Counter\n\ndef input():\n\treturn sys.stdin.readline().strip()\n\ndef list2d(a, b, c):\n\treturn [[c] * b for i in range(a)]\n\ndef list3d(a, b, c, d):\n\treturn [[[d] * c for j in range(b)] for i in range(a)]\n\ndef list4d(a, b, c, d, e):\n\treturn [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\ndef ceil(x, y=1):\n\treturn int(-(-x // y))\n\ndef INT():\n\treturn int(input())\n\ndef MAP():\n\treturn map(int, input().split())\n\ndef LIST(N=None):\n\treturn list(MAP()) if N is None else [INT() for i in range(N)]\n\ndef Yes():\n\tprint('Yes')\n\ndef No():\n\tprint('No')\n\ndef YES():\n\tprint('YES')\n\ndef NO():\n\tprint('NO')\nINF = 10 ** 18\nMOD = 10 ** 9 + 7\nfor _ in range(INT()):\n\t(N, M) = MAP()\n\tif N % M == 0:\n\t\tYES()\n\telse:\n\t\tNO()\n", "t = int(input())\nwhile t > 0:\n\tt -= 1\n\tline = input().split(' ')\n\tn = int(line[0])\n\tm = int(line[1])\n\tif n == m or n % m == 0:\n\t\tprint('YES')\n\t\tcontinue\n\tprint('NO')\n", "def polygon():\n\tcases = int(input())\n\tsize = []\n\tfor i in range(cases):\n\t\tsize.append(input().split())\n\tfor i in range(len(size)):\n\t\tif int(size[i][1]) >= int(size[i][0]) - 1:\n\t\t\tprint('NO')\n\t\telif int(size[i][0]) % int(size[i][1]) != 0:\n\t\t\tprint('NO')\n\t\telse:\n\t\t\tprint('YES')\npolygon()\n", "for _ in range(int(input())):\n\t(n, m) = map(int, input().split())\n\tres = str('YES') if n % m == 0 else str('NO')\n\tprint(res)\n", "b = ['YES', 'NO']\nt = int(input())\nfor _ in range(t):\n\t(n, m) = map(int, input().split())\n\tprint(b[min(n % m, 1)])\n", "import sys\nRI = lambda : [int(x) for x in sys.stdin.readline().split()]\nri = lambda : sys.stdin.readline().strip()\nfor _ in range(int(ri())):\n\t(a, b) = RI()\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "a = int(input())\nfor i in range(a):\n\t(x, y) = map(int, input().split())\n\tif x % y == 0 and y <= x:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nfor _ in range(t):\n\t(a, b) = [int(x) for x in input().split()]\n\tif a % b == 0 or b % a == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "import sys\n\ndef solve():\n\tnumList = list(map(int, input().split()))\n\tif numList[0] % numList[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nt = int(input())\nfor i in range(t):\n\tsolve()\n", "from sys import stdin\nt = int(stdin.readline())\nfor i in range(t):\n\t(n, m) = list(map(int, stdin.readline().split(' ')))\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "I = lambda : list(map(int, input().split()))\nfor _ in range(int(input())):\n\t(n, m) = I()\n\tprint('YES') if n % m == 0 else print('NO')\n", "t = int(input())\nfor i in range(t):\n\ttemp = [int(x) for x in input().split()]\n\tn = temp[0]\n\tm = temp[1]\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "def two_regular_polygons(n: int, m: int) -> str:\n\tif n % m == 0:\n\t\treturn 'YES'\n\treturn 'NO'\nt = int(input())\npolygons = []\nfor i in range(t):\n\t(n, m) = input().split()\n\tpolygons.append([int(n), int(m)])\nfor i in range(t):\n\t(n, m) = polygons[i]\n\tprint(two_regular_polygons(n, m))\n", "import math\n\ndef dtb(n):\n\treturn bin(n).replace('0b', '')\n\ndef btd(n):\n\treturn int(n, 2)\nt = int(input())\nfor k in range(t):\n\t(n, m) = map(int, input().split())\n\tif n <= 5:\n\t\tprint('NO')\n\t\tcontinue\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "t = int(input())\nb = []\nfor i in range(t):\n\t[n, m] = [int(x) for x in input().split()]\n\tb.append('YES' if n % m == 0 else 'NO')\nfor i in b:\n\tprint(i)\n", "a = int(input())\nfor i in range(a):\n\tl = list(map(int, input().split()))\n\tb = sorted(l)\n\tif b[1] % b[0] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "c = int(input())\nfor _ in range(c):\n\t(a, b) = reversed(sorted(list(map(int, input().split()))))\n\tif a % b == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "testes = int(input())\nfor t in range(testes):\n\tent = input().split(' ')\n\tvertices = int(ent[0])\n\tnovo = int(ent[1])\n\tif vertices % novo == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nfor i in range(n):\n\t(n1, n2) = map(int, input().split())\n\tif n1 % n2 == 0 or n2 % n1 == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "n = int(input())\nwhile n:\n\tl1 = [int(i) for i in input().split()]\n\tif l1[0] % l1[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n\tn -= 1\n", "a = int(input())\narr = []\nfor i in range(a):\n\tb = [int(g) for g in str(input()).split()]\n\tif b[0] % b[1] == 0:\n\t\tarr.append('YES')\n\telse:\n\t\tarr.append('NO')\nfor k in arr:\n\tprint(k)\n", "from __future__ import division, print_function\nimport os, sys\nfrom io import BytesIO, IOBase\nif sys.version_info[0] < 3:\n\tfrom __builtin__ import xrange as range\n\tfrom future_builtins import ascii, filter, hex, map, oct, zip\n\ndef so():\n\treturn int(input())\n\ndef st():\n\treturn input()\n\ndef mj():\n\treturn map(int, input().strip().split(' '))\n\ndef msj():\n\treturn map(str, input().strip().split(' '))\n\ndef le():\n\treturn list(map(int, input().split()))\n\ndef dmain():\n\tsys.setrecursionlimit(1000000)\n\tthreading.stack_size(1024000)\n\tthread = threading.Thread(target=main)\n\tthread.start()\n\ndef decimalToBinary(n):\n\treturn bin(n).replace('0b', '')\n\ndef read():\n\tsys.stdin = open('input.txt', 'r')\n\tsys.stdout = open('output.txt', 'w')\n\ndef main():\n\tfor i in range(so()):\n\t\t(a, b) = mj()\n\t\tif a % b == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nBUFSIZE = 8192\n\nclass FastIO(IOBase):\n\tnewlines = 0\n\n\tdef __init__(self, file):\n\t\tself._fd = file.fileno()\n\t\tself.buffer = BytesIO()\n\t\tself.writable = 'x' in file.mode or 'r' not in file.mode\n\t\tself.write = self.buffer.write if self.writable else None\n\n\tdef read(self):\n\t\twhile True:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tif not b:\n\t\t\t\tbreak\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines = 0\n\t\treturn self.buffer.read()\n\n\tdef readline(self):\n\t\twhile self.newlines == 0:\n\t\t\tb = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))\n\t\t\tself.newlines = b.count(b'\\n') + (not b)\n\t\t\tptr = self.buffer.tell()\n\t\t\t(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))\n\t\tself.newlines -= 1\n\t\treturn self.buffer.readline()\n\n\tdef flush(self):\n\t\tif self.writable:\n\t\t\tos.write(self._fd, self.buffer.getvalue())\n\t\t\t(self.buffer.truncate(0), self.buffer.seek(0))\n\nclass IOWrapper(IOBase):\n\n\tdef __init__(self, file):\n\t\tself.buffer = FastIO(file)\n\t\tself.flush = self.buffer.flush\n\t\tself.writable = self.buffer.writable\n\t\tself.write = lambda s: self.buffer.write(s.encode('ascii'))\n\t\tself.read = lambda : self.buffer.read().decode('ascii')\n\t\tself.readline = lambda : self.buffer.readline().decode('ascii')\n\ndef print(*args, **kwargs):\n\t(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))\n\tat_start = True\n\tfor x in args:\n\t\tif not at_start:\n\t\t\tfile.write(sep)\n\t\tfile.write(str(x))\n\t\tat_start = False\n\tfile.write(kwargs.pop('end', '\\n'))\n\tif kwargs.pop('flush', False):\n\t\tfile.flush()\nif sys.version_info[0] < 3:\n\t(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))\nelse:\n\t(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))\ninput = lambda : sys.stdin.readline().rstrip('\\r\\n')\nmain()\n", "try:\n\tfor _ in range(int(input())):\n\t\t(n, m) = map(int, input().split())\n\t\tif n % m == 0:\n\t\t\tprint('YES')\n\t\telse:\n\t\t\tprint('NO')\nexcept:\n\tpass\n", "def I():\n\treturn map(int, input().split())\nfor _ in range(int(input())):\n\t(n, m) = I()\n\tprint('YNEOS'[n % m != 0::2])\n", "from sys import stdin\n\ndef read_tuple():\n\treturn map(int, input().split())\n\ndef read_int():\n\treturn int(input())\n\ndef read_list():\n\treturn list(map(int, input().split()))\n\ndef read_str_list():\n\treturn list(input().split())\nfor _ in range(read_int()):\n\t(n, m) = read_tuple()\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\n", "from sys import stdin, stdout\nint_in = lambda : int(stdin.readline())\narr_in = lambda : [int(x) for x in stdin.readline().split()]\nmat_in = lambda rows: [arr_in() for y in range(rows)]\nstr_in = lambda : stdin.readline().strip()\nout = lambda o: stdout.write('{}\\n'.format(o))\narr_out = lambda o: out(' '.join(map(str, o)))\nbool_out = lambda o: out('YES' if o else 'NO')\n\ndef solve(n, m):\n\treturn n % m == 0\nfor i in range(int_in()):\n\t(n, m) = arr_in()\n\tbool_out(solve(n, m))\n", "import math\n\ndef main():\n\t(n, m) = map(int, input().split())\n\tif n % m == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nt = int(input())\nfor i in range(t):\n\tmain()\n", "tests = int(input())\nfor i in range(tests):\n\tin_str = input().split(' ')\n\ttupl = (int(in_str[0]), int(in_str[1]))\n\tprint('YES' if tupl[0] % tupl[1] == 0 else 'NO')\n", "times = int(input())\nanswer = list()\nfor i in range(times):\n\t(a, b) = map(int, input().split())\n\tif a % b == 0:\n\t\tanswer.append('YES')\n\telse:\n\t\tanswer.append('NO')\nfor i in answer:\n\tprint(i)\n", "import sys\n\ndef div(arr):\n\tif arr[0] % arr[1] == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')\nuserInput = sys.stdin.readlines()\nstrLen = int(userInput[0].rstrip())\nfor i in range(1, strLen + 1):\n\tdiv(list(map(int, userInput[i].rstrip().split())))\n"]

difficulty: EASY

source: codeforces

raw_problem:
A. Two Regular Polygons

time limit per test
1 second

memory limit per test
256 megabytes

input
standard input

output
standard output

You are given two integers $$$n$$$ and $$$m$$$ ($$$m < n$$$). Consider a convex regular polygon of $$$n$$$ vertices. Recall that a regular polygon is a polygon that is equiangular (all angles are equal in measure) and equilateral (all sides have the same length).
  Examples of convex regular polygons
Your task is to say if it is possible to build another convex regular polygon with $$$m$$$ vertices such that its center coincides with the center of the initial polygon and each of its vertices is some vertex of the initial polygon.

You have to answer $$$t$$$ independent test cases.

Input

The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.

The next $$$t$$$ lines describe test cases. Each test case is given as two space-separated integers $$$n$$$ and $$$m$$$ ($$$3 \le m < n \le 100$$$) — the number of vertices in the initial polygon and the number of vertices in the polygon you want to build.

Output

For each test case, print the answer — "YES" (without quotes), if it is possible to build another convex regular polygon with $$$m$$$ vertices such that its center coincides with the center of the initial polygon and each of its vertices is some vertex of the initial polygon and "NO" otherwise.

Example

Input

2
6 3
7 3

Output

YES
NO

Note
  The first test case of the example
It can be shown that the answer for the second test case of the example is "NO".

question:
You are given two integers $$$n$$$ and $$$m$$$ ($$$m < n$$$). Consider a convex regular polygon of $$$n$$$ vertices. Recall that a regular polygon is a polygon that is equiangular (all angles are equal in measure) and equilateral (all sides have the same length).
 ![image](1.png) Examples of convex regular polygons Your task is to say if it is possible to build another convex regular polygon with $$$m$$$ vertices such that its center coincides with the center of the initial polygon and each of its vertices is some vertex of the initial polygon.
You have to answer $$$t$$$ independent test cases.

Input
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
The next $$$t$$$ lines describe test cases. Each test case is given as two space-separated integers $$$n$$$ and $$$m$$$ ($$$3 \le m < n \le 100$$$) — the number of vertices in the initial polygon and the number of vertices in the polygon you want to build.

Output
For each test case, print the answer — "YES" (without quotes), if it is possible to build another convex regular polygon with $$$m$$$ vertices such that its center coincides with the center of the initial polygon and each of its vertices is some vertex of the initial polygon and "NO" otherwise.

Example
Input
2
6 3
7 3

Output
YES
NO

Note
 ![image](2.png) The first test case of the example It can be shown that the answer for the second test case of the example is "NO".

tags: ['Geometry', 'Number theory', 'Mathematics', 'Greedy algorithms']

skill_types: ['Greedy algorithms']

raw_tags: ['greedy', 'number theory', 'geometry', 'math']

image_tags:
2D Geometry
2D Geometry

data_split: test