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] 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----- $0$ The first test case of the example 

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

Difficulty: EASY
Tags: Geometry

Number theory

Mathematics

Greedy algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().rstrip().split()))
	if a % b == 0:
		print('YES')
	else:
		print('NO')


t = int(input(''))
for i in range(t):
	s = input('')
	L = s.split(' ')
	(n, m) = (int(L[0]), int(L[1]))
	if n % m == 0:
		print('YES')
	else:
		print('NO')


from math import *
from collections import *
from operator import itemgetter
import bisect
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
chrIdx = lambda x: ord(x) - 96
idxChr = lambda x: chr(96 + x)
t = ii()
for i in range(t):
	(n, m) = iia()
	n = max(n, m)
	m = min(n, m)
	if (n - m) % m == 0:
		print('YES')
	else:
		print('NO')


from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = int(pow(10, 9) + 7)

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'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}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')

def binsearch(a, l, r, x):
	while l <= r:
		mid = l + (r - 1) // 2
		if a[mid]:
			return mid
		elif a[mid] > x:
			l = mid - 1
		else:
			r = mid + 1
	return -1

def dfs(d, v):
	q = []
	q.insert(0, v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.insert(0, i)
		print(x)
for _ in range(ii()):
	(a, b) = mi()
	if a % b == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for z in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def func():
	(m, n) = map(int, input().split())
	if m % n == 0:
		print('YES')
	else:
		print('NO')
T = int(input())
for _ in range(T):
	func()


for i in range(int(input())):
	(n, m) = list(map(int, input().split()))
	if n % m == 0:
		print('YES')
	else:
		print('NO')


m = int(input())
l = []
for _ in range(m):
	(a, b) = map(int, input().split())
	l.append('YES' if a % b == 0 else 'NO')
for i in l:
	print(i)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if pow(a, 1, b) == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = list(map(int, input().split()))
	a = n / m
	if a.is_integer():
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	if x % y == 0:
		print('YES')
	else:
		print('NO')


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	(n, m) = inputnums()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = (int(x) for x in input().split())
	print('YES' if n % m == 0 else 'NO')


def main():
	t = int(input())
	for __ in range(t):
		(n, m) = map(int, input().split())
		if n % m == 0:
			print('YES')
		else:
			print('NO')
main()


i = int(input())
for j in range(i):
	n = input().split(' ')
	if int(n[0]) % int(n[1]) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	if not a % b:
		print('YES')
	else:
		print('NO')


t = int(input())
for j in range(t):
	n = list(map(int, input().split()))
	if n[1] > 2:
		if n[0] % n[1] == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


import math as m

def f1():
	N = int(input())
	Matrix = list()
	for i in range(0, N):
		input1 = [int(i) for i in input().split(' ')]
		Matrix.append(input1)

def f2():
	N = int(input())
	Matrix = list()
	for i in range(0, N):
		input1 = [int(i) for i in input().split(' ')]
		if input1[0] % input1[1] == 0:
			print('YES')
		else:
			print('NO')

def f3():
	N = int(input())
f2()


t = int(input())
count = 0
result = []
while count < t:
	s = input()
	(n, m) = s.split()
	if int(n) % int(m) == 0:
		result.append('YES')
	else:
		result.append('NO')
	count += 1
for x in result:
	print(x)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print('YES' if x % y == 0 else 'NO')


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print('YNEOS'[a % b != 0::2])


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a % b == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, m) = input().strip().split(' ')
	(n, m) = [int(n), int(m)]
	if n % m:
		print('NO')
	else:
		print('YES')


import sys
input = lambda : sys.stdin.readline().rstrip()
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	print('YES' if n % m == 0 else 'NO')


t = int(input())
while t > 0:
	t -= 1
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


from math import ceil
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	print(['NO', 'YES'][not a % b])


t = input()
t = int(t)
answers = []
for n in range(t):
	case = input()
	nm = list(map(int, case.split(' ')))
	if nm[0] % nm[1] == 0:
		answers.append('YES')
	else:
		answers.append('NO')
for n in answers:
	print(n)


t = int(input())
for T in range(t):
	(n, m) = list(map(int, input().split()))
	if n % m == 0:
		print('YES')
	else:
		print('NO')


import sys

def main():
	for _ in range(int(sys.stdin.readline())):
		(a, b) = map(int, sys.stdin.readline().split())
		if a % b == 0:
			print('YES')
		else:
			print('NO')
main()


import sys
input = sys.stdin.readline

def fastio():
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
(t,) = I()
while t:
	t -= 1
	(n, m) = I()
	ans = 'NO'
	if n % m == 0:
		ans = 'YES'
	print(ans)


from fractions import Fraction
import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = 1000000007

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def solve():
	(n, m) = sep()
	if n % m == 0:
		print('YES')
	else:
		print('NO')
testcase(int(inp()))


def rgon():
	T = int(input())
	for i in range(T):
		para = input().split(' ')
		(n, m) = (int(para[0]), int(para[1]))
		if n % m == 0:
			print('YES')
		else:
			print('NO')
rgon()


t = int(input())
for _t in range(t):
	(n, m) = (int(x) for x in input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(n, m) = [int(x) for x in input().split(' ')]
	if n % m == 0:
		print('YES')
	else:
		print('NO')
	t -= 1


from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 1000000007
INF = float('inf')

def main():
	for _ in range(N()):
		(n, m) = RL()
		if n % m == 0:
			print('YES')
		else:
			print('NO')
main()


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	print('YES') if float(n / m).is_integer() and float(n / m) != 0 else print('NO')


q = int(input())
while q:
	(n, m) = map(int, input().split())
	if n % m:
		print('NO')
	else:
		print('YES')
	q -= 1


inf = int(1000000.0)
a = ord('A')
z = ord('Z')
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
a = []
for i in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0 and n != 4:
		a.append('YES')
	else:
		a.append('NO')
for i in a:
	print(i)


c = int(input())
while c:
	s1 = input()
	li = s1.split(' ')
	if int(li[0]) % int(li[1]) == 0:
		print('YES')
	else:
		print('NO')
	c = c - 1


def calc():
	print()

def main():
	for _ in range(int(input())):
		(n, m) = map(int, input().split())
		if n % m == 0:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
for i in range(t):
	dados = input()
	dados = dados.split(' ')
	dado1 = int(dados[0])
	dado2 = int(dados[1])
	if dado1 % dado2 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
l = []
for _ in range(t):
	j = input().split(' ')
	n = int(j[0])
	m = int(j[1])
	if n % m == 0:
		l.append('YES')
	else:
		l.append('NO')
for i in l:
	print(i)


t = int(input())
for _ in range(t):
	(n, m) = list(map(int, input().split(' ')))
	print('NO' if n % m else 'YES')


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	if n < 6:
		print('NO')
	elif n % m == 0 and m > 2:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	elif m % n == 0:
		print('YES')
	else:
		print('NO')


from sys import stdin

def func():
	return
for _ in range(int(stdin.readline())):
	(n, m) = map(int, stdin.readline().split())
	if n % m == 0 or m % n == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
l = []
for i in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		l.append('YES')
	else:
		l.append('NO')
for ans in l:
	print(ans)


import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	t = II()
	for _ in range(t):
		(n, m) = MI()
		if n % m:
			print('NO')
		else:
			print('YES')
main()


t = int(input())
nm = [list(map(int, input().split())) for _ in range(t)]
for nmi in nm:
	if nmi[0] % nmi[1] == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for case_num in range(t):
	(a, b) = map(int, input().split(' '))
	print('YES' if a % b == 0 else 'NO')


t = int(input())
b = [0] * t
for i in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		b[i] = 1
for i in range(t):
	if b[i] == 1:
		print('YES')
	else:
		print('NO')


testcases = eval(input())
poly = []
for n in range(testcases):
	poly.append(input())
for polydata in poly:
	outpoly = int(polydata.split(' ')[0])
	inpoly = int(polydata.split(' ')[1])
	if not outpoly % inpoly:
		print('YES')
	else:
		print('NO')


printn = lambda x: print(x, end='')
inn = lambda : int(input())
inl = lambda : list(map(int, input().split()))
inm = lambda : map(int, input().split())
ins = lambda : input().strip()
DBG = True
BIG = 10 ** 18
R = 10 ** 9 + 7

def ddprint(x):
	if DBG:
		print(x)
t = inn()
for tt in range(t):
	(n, m) = inm()
	print('YES' if n % m == 0 else 'NO')


def solve(n, m):
	if n % m:
		return 'NO'
	else:
		return 'YES'

def main():
	t = int(input())
	for _ in range(t):
		(n, m) = [int(i) for i in input().split()]
		print(solve(n, m))
main()


t = int(input())
for k in range(t):
	(n, m) = map(int, input().split())
	if n / m % 1 == 0:
		print('Yes')
	else:
		print('No')


t = int(input())
while t > 0:
	n = input().split(' ')
	(n, m) = (int(n[0]), int(n[1]))
	if n % m == 0:
		print('Yes')
	else:
		print('No')
	t -= 1


import sys
for _ in range(int(sys.stdin.readline())):
	(n, r) = map(int, sys.stdin.readline().split())
	if n % r == 0 and r > 2 and (n != r):
		sys.stdout.write('YES\n')
	else:
		sys.stdout.write('NO\n')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
testcases = int(input())
for j in range(testcases):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().strip().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
m = []
k = []
for i in range(n):
	(x, y) = map(int, input().split())
	m.append(x)
	k.append(y)
for i in range(n):
	if m[i] % k[i] == 0:
		print('yes')
	else:
		print('no')


def solve():
	t = int(input())
	for i in range(t):
		(n, m) = [int(s) for s in input().split()]
		if n % m == 0:
			print('YES')
		else:
			print('NO')
solve()


import math
for t in range(int(input())):
	(n, m) = map(int, input().split())
	x = (n - m) / m
	print('YES' if math.ceil(x) == x else 'NO')


import sys
from math import *
from collections import defaultdict
from queue import deque
from heapq import heappush, heappop
lines = [line.strip() for line in sys.stdin.readlines()]
t = int(lines[0])
for tt in range(t):
	(x, y) = list(map(int, lines[1 + tt].split()))
	print('YES' if x % y == 0 else 'NO')


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math

def bin1(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = k ** mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin1(mid + 1, r, k, t, b, val, ans)
		else:
			return bin1(l, mid - 1, k, t, b, val, ans)

def bin2(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = t * k ** mid + b * mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin2(l, mid - 1, k, t, b, val, ans)
		else:
			return bin2(mid + 1, r, k, t, b, val, ans)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	l = []
	for i in range(2, n + 1):
		if prime[i]:
			l.append(i)
	return l

def bin(l, r, ll, val):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		if val >= ll[mid][0] and val <= ll[mid][1]:
			return mid
		elif val < ll[mid][0]:
			return bin(l, mid - 1, ll, val)
		else:
			return bin(mid + 1, r, ll, val)

def deci(n):
	s = ''
	while n != 0:
		if n % 2 == 0:
			n = n // 2
			s = '0' + s
		else:
			n = n // 2
			s = '1' + s
	return s

def diff(s1, s2):
	if len(s1) < len(s2):
		v = len(s1)
		while v != len(s2):
			s1 = '0' + s1
			v = v + 1
	else:
		v = len(s2)
		while v != len(s1):
			s2 = '0' + s2
			v = v + 1
	c = 0
	for i in range(len(s1)):
		if s1[i:i + 1] != s2[i:i + 1]:
			c = c + 1
	return c
from sys import stdin, stdout

def fac(a, b):
	v = a
	while a != b:
		v *= a - 1
		a = a - 1
	return v

def bino(l, r, n):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		val1 = math.log(n / mid + 1, 2)
		val2 = int(val1)
		if val1 == val2:
			return val1
		elif val1 < 1.0:
			return bino(l, mid - 1, n)
		else:
			return bino(mid + 1, r, n)

def binary(l, r, ll, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		if ll[mid] <= val:
			ans = mid
			return binary(mid + 1, r, ll, val, ans)
		else:
			return binary(l, mid - 1, ll, val, ans)
t = int(stdin.readline())
for i in range(t):
	(a, b) = map(int, stdin.readline().split(' '))
	if a % b == 0:
		stdout.write('YES' + '\n')
	else:
		stdout.write('NO' + '\n')


from math import *
zzz = int(input())
for zz in range(zzz):
	(n, m) = map(int, input().split())
	print('YES' if n / m == int(n / m) else 'NO')


import sys
numbers = sys.stdin.read()
numbers = numbers.split()
i = 1
for pair in range(int(numbers[0])):
	if int(numbers[i]) % int(numbers[i + 1]) == 0:
		print('YES')
	else:
		print('NO')
	i += 2


from sys import stdin

def is_possible(a, b):
	return a % b == 0
n = int(stdin.readline())
for _ in range(n):
	(a, b) = map(int, stdin.readline().split())
	print('YES' if is_possible(a, b) else 'NO')


from sys import stdin, stdout
import math

def main():
	t = int(input())
	while t:
		(n, m) = map(int, input().split())
		if n % m == 0:
			print('YES')
		else:
			print('NO')
		t -= 1
main()


import sys
input = sys.stdin.readline
from collections import *
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


import sys
import math

def ii():
	return sys.stdin.readline().strip()

def idata():
	return [int(x) for x in ii().split()]

def binary_search(array, x):
	(left, right) = (-1, len(array))
	while left + 1 != right:
		middle = (left + right) // 2
		if array[middle] >= x:
			right = middle
		elif array[middle] < x:
			left = middle
	return right

def solve_of_problem():
	(n, m) = idata()
	if n % m == 0:
		print('YES')
	else:
		print('NO')
	return
for ______ in range(int(ii())):
	solve_of_problem()


from sys import stdin
t = int(stdin.readline().rstrip())
for i in range(t):
	(n, m) = [int(x) for x in stdin.readline().rstrip().split()]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
lis = []
for i in range(t):
	a = list(map(int, input().split()))
	lis.append(a)
for j in range(t):
	if lis[j][0] % lis[j][1] == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	li = [int(i) for i in input().split()]
	n = li[0]
	m = li[1]
	if n % m == 0:
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
l = []
for i in range(t):
	n = list(map(int, input().split()))
	l.append('YES' if max(n) % min(n) == 0 else 'NO')
for i in l:
	print(i)


import sys
n = int(sys.stdin.readline())
for _ in range(n):
	line = sys.stdin.readline().split()
	(a, b) = (int(line[0]), int(line[1]))
	if a % b == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(n, m) = [int(i) for i in input().split(' ')]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(n, m) = [int(i) for i in input().split()]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	print('Yes' if n % m == 0 else 'No')


def main():
	(n, m) = map(int, input().split())
	print('NYOE S'[1 if n % m == 0 else 0::2])
T = int(input())
for _ in range(T):
	main()


from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time

def I():
	return int(input())

def MI():
	return map(int, input().split())

def S():
	return input()

def MS():
	return map(str, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def StoI():
	return [ord(i) - 97 for i in input()]

def ItoS(nn):
	return chr(nn + 97)

def input():
	return sys.stdin.readline().rstrip()

def print_matrix(mat):
	for i in range(len(mat)):
		print(*mat[i])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
YN = {False: 'NO', True: 'YES'}
MOD = 10 ** 9 + 7
inf = float('inf')
IINF = 10 ** 10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False

def solve(T):
	(n, m) = MI()
	print(YN[n % m == 0])

def main():
	T = I()
	for i in range(T):
		solve(T)
main()


from sys import stdin, stdout
for i in range(int(stdin.readline())):
	(ip, sp) = [int(x) for x in stdin.readline().split()]
	stdout.write('YES\n' if ip % sp == 0 else 'NO\n')


for i in [*open(0)][1:]:
	(n, m) = map(int, i.split())
	print('NO' if n % m else 'YES')


import sys
import math

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]
t = read_int()
for i in range(t):
	(n, m) = read_int_line()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


from sys import stdin
from math import gcd
T = int(input())
for _ in range(T):
	(n, m) = map(int, stdin.readline().split())
	if (n - m) % m == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	li = list(map(int, input().split()))
	m = li[0]
	n = li[1]
	if m % n == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for case in range(t):
	(n, m) = [int(s) for s in input().split(' ')]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(s, f) = map(int, input().split())
	if s % f != 0:
		print('NO')
	else:
		print('YES')


import math
import collections
import functools
import sys
import os

def solve():
	(n, m) = list(map(int, input().split()))
	if n % m == 0:
		print('YES')
	else:
		print('NO')

def main():
	T = 1
	T = int(input())
	while T:
		solve()
		T -= 1
main()


t = int(input())
for i in range(t):
	(n, m) = map(int, input().rsplit())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


v = int(input())
for k in range(v):
	entrada = list(map(int, input().split(' ')))
	n = entrada[0]
	m = entrada[1]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def polygon(a, b):
	return a % b == 0
t = int(input())
for i in range(1, t + 1):
	(a, b) = [int(s) for s in input().split(' ')]
	h = polygon(a, b)
	ans = ['NO', 'YES'][h]
	print(ans)


def func(n, m):
	if n % m == 0:
		return 'YES'
	else:
		return 'NO'
t = int(input())
l = []
for i in range(t):
	(n, m) = map(int, input().split())
	l.append(func(n, m))
for i in l:
	print(i)


import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2 ** 62 - 1

def read_int():
	return int(input())

def read_int_n():
	return list(map(int, input().split()))

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

@mt
def slv(N, M):
	if M < 3:
		return 'NO'
	if N % M == 0:
		return 'YES'
	return 'NO'

def main():
	T = read_int()
	for _ in range(T):
		(N, M) = read_int_n()
		print(slv(N, M))
main()


def twopoly(m, n):
	if m % n == 0:
		return 'YES'
	else:
		return 'NO'
cases = int(input())
for _ in range(cases):
	(m, n) = list(map(int, input().split()))
	print(twopoly(m, n))


import sys
t = int(input())
for i in range(t):
	(n, m) = map(int, sys.stdin.readline().split())
	print('NO' if n % m else 'YES')


import sys
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


no = int(input())
res = []
for i in range(no):
	(n, m) = map(int, input().split())
	if n % m == 0:
		res.append('YES')
	else:
		res.append('NO')
for i in res:
	print(i)


for i in range(int(input())):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if a % b == 0:
		print('YES')
	else:
		print('NO')


for _ in [*open(0)][1:]:
	(n, m) = map(int, _.split())
	print('NYOE S'[n % m == 0::2])


t = int(input())
c = []
for i in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		c.append('YES')
	else:
		c.append('NO')
for j in c:
	print(j)


def polygon(x, y):
	if x % y == 0 or x % y % y == 0:
		return 'Yes'
	else:
		return 'No'
t = int(input())
array = []
for z in range(t):
	subarray = list(map(int, input().split()))
	array.append(subarray)
for z in range(t):
	x = array[z][0]
	y = array[z][1]
	print(polygon(x, y))


test = int(input())
for i in range(test):
	nd = input().split()
	n = int(nd[0])
	k = int(nd[1])
	if n % k == 0:
		print('YES')
	else:
		print('NO')


from math import *
T = int(input())
while T:
	T -= 1
	(a, b) = map(int, input().split())
	if a % b == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	if not a % b:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	v = input().split()
	if int(v[0]) % int(v[1]) == 0:
		print('YES')
	else:
		print('NO')
	t -= 1
	v.clear()


def prime(n):
	if n < 2:
		return []
	l = [2]
	for x in range(3, n + 1):
		for y in l:
			if x % y == 0:
				break
		else:
			l += [x]
	return l
l = int(input())
for x in range(l):
	m = list(map(int, input().split()))
	if m[0] > 4 and m[0] % m[1] == 0:
		print('YES')
	else:
		print('NO')


tc = int(input())
while tc:
	(n, m) = list(map(int, input().split()))
	if n % m == 0:
		print('YES')
	else:
		print('NO')
	tc -= 1


t = int(input())
for test in range(t):
	(n, m) = input().split()
	(n, m) = (int(n), int(m))
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def solution():
	from sys import stdout, stdin
	(_input, _print) = (stdin.readline, stdout.write)
	for _ in range(int(_input())):
		(n, m) = [int(i) for i in input().split()]
		if n == m:
			print('NO')
			continue
		elif n % m == 0:
			print('YES')
			continue
		else:
			print('NO')
			continue
solution()


import sys
testcase = int(sys.stdin.readline())
for _ in range(testcase):
	(n, m) = map(int, sys.stdin.readline().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for t_itr in range(t):
	inp = input()
	inp = inp.split()
	m = int(inp[0])
	n = int(inp[1])
	if m % n == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = tuple(map(int, input().split()))
	if not n % m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	print('NYOE S'[n % m == 0 or m % n == 0::2])


from math import ceil, sqrt, gcd, log, floor
from collections import deque

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())
for _ in range(ii()):
	(n, m) = mi()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(a, b) = map(int, input().split())
	if a % b == 0:
		print('YES')
	else:
		print('NO')
	t -= 1


T = int(input())
for _ in range(T):
	(p, q) = map(int, input().split())
	if p % q == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
result = str()
for i in range(t):
	(n, m) = list(map(int, input().split()))
	if not n % m:
		result += '\nYES'
	else:
		result += '\nNO'
result = result.strip()
print(result)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(x, y):
	return f(x) // (f(y) * f(x - y))
from collections import defaultdict
from heapq import heappop, heappush, heapify
t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a % b == 0 or b % a == 0:
		print('YES')
	else:
		print('NO')


t = int(input().strip())
from math import gcd
for _ in range(t):
	(n, m) = map(int, input().strip().split())
	if gcd(m, n) != m:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('Yes')
	else:
		print('No')


t = input()
t = int(t)
i = 0
while i < t:
	riga = list(map(int, input().strip().split()))
	n = riga[0]
	m = riga[1]
	if n % m == 0:
		print('YES')
	else:
		print('NO')
	i = i + 1


for _ in range(int(input())):
	(n, m) = list(map(int, input().split()))
	print(('YES', 'NO')[n % m != 0])


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	if k > n:
		print('NO')
	elif n % k == 0:
		print('YES')
	else:
		print('NO')


s = input()
while True:
	try:
		(a, b) = map(int, input().split(' '))
		if a % b == 0:
			print('YES')
		else:
			print('NO')
	except:
		break


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		(a, b) = list(map(int, input().split()))
		if a % b == 0:
			yield 'YES'
		else:
			yield 'NO'
t = int(input())
ans = gift()
print(*ans, sep='\n')


n = int(input())
Result = []
for i in range(0, n):
	Nuhash = list(map(int, input().strip().split()))[0:2]
	Initial = Nuhash[0]
	term = Nuhash[1]
	if Initial % term == 0:
		Result.append('YES')
	else:
		Result.append('NO')
for i in Result:
	print(i)


from math import *
from collections import *
from itertools import *
from bisect import *
from operator import *
import sys

def io():
	return map(int, input().split())

def op():
	return list(map(int, input().split()))

def o():
	return int(input())

def kl(con, x=0):
	if x == 0:
		print('Yes') if con else print('No')
	elif x == 1:
		print('yes') if con else print('no')
	elif x == 2:
		print('YES') if con else print('NO')
p = input
for _ in range(o()):
	(a, b) = io()
	kl(a % b == 0, 2)


import sys, math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
t = 1
t = inp()
for tt in range(t):
	(n, m) = invr()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	div = []
	for j in range(1, n):
		if n % j == 0:
			div.append(j)
	if div.count(m) != 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(m, n) = [int(x) for x in input().split()]
	print('YNEOS'[m % n > 0::2])


import sys
Input = sys.stdin.readline
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print('YES') if a % b == 0 else print('NO')


from bisect import *
from math import *
t = int(input())
for i in range(t):
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for T in range(t):
	(n, m) = [int(x) for x in input().split()]
	if n / m == n // m:
		print('YES')
	else:
		print('NO')


import math
q = int(input())
for _ in range(q):
	(x, y) = map(int, input().split())
	if x % y == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for o in range(t):
	ch = input()
	p = ch.split(' ')
	n = int(p[0])
	m = int(p[1])
	if n % m == 0:
		print('YES')
	else:
		print('NO')


from functools import reduce
import os
import sys
from collections import *
from math import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
inf = 1e+18
for _ in range(inn()):
	(n, m) = value()
	ans = 'NO'
	if n % m == 0:
		ans = 'YES'
	print(ans)


for t in range(int(input())):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('yes')
	else:
		print('no')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	print(('NO', 'YES')[a % b == 0])


Case = int(input())
for i in range(0, Case):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES', end='\n')
	else:
		print('NO', end='\n')


from sys import stdin, stdout
import traceback
read = stdin.readline
write = stdout.write
writeln = lambda x: write(str(x) + '\n')

def reads(typ=int):
	return list(map(typ, read().split()))

class Sol:

	@classmethod
	def input(cls):
		s = cls()
		return s

	def solve(self):
		(n, m) = reads()
		return n % m == 0
try:
	for _ in range(int(read())):
		writeln('YES' if Sol.input().solve() else 'NO')
except Exception as e:
	print('Got exception:', repr(e))
	print(traceback.format_exc())


from collections import Counter
k = int(input())
for _ in range(k):
	(n, m) = input().split(' ')
	if int(n) % int(m) == 0:
		print('YES')
	else:
		print('NO')


from math import ceil, log, floor, sqrt
import math
k = 1

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def is_prime(n):
	m = 2
	while m * m <= n:
		if n % m == 0:
			return False
		m += 1
	return True

def find_sum(n, a):
	a.insert(0, 0)
	for i in range(1, n + 1):
		prev = a[i] & a[i - 1]
		cur = a[i] | a[i - 1]
		a[i - 1] = prev
		a[i] = cur
	return sum((m * m for m in a))

def prin_abc(x, y, z):
	l = [x, y, z]
	l.sort()
	if l[1] < l[2]:
		print('NO')
		return
	a = b = l[0]
	c = l[2]
	print('YES')
	print(a, b, c)

def get_scores(n, vals):
	l = 0
	r = n - 1
	turn = 0
	sereja = 0
	dima = 0
	while l <= r:
		if vals[l] > vals[r]:
			cur = vals[l]
			l += 1
		else:
			cur = vals[r]
			r -= 1
		if turn == 0:
			sereja += cur
		else:
			dima += cur
		turn = not turn
	print(sereja, dima)

def count_lamps(n, m):
	return (n * m + 1) // 2

def count_moves(n, name):
	mvs = 0
	cnt = 0
	for i in range(n):
		if name[i] == 'x':
			cnt += 1
		else:
			mvs += max(0, cnt - 2)
			cnt = 0
	mvs += max(0, cnt - 2)
	return mvs

def can_exist(n, m):
	return n % m == 0 or m % n == 0
t = 1
t = int(input())
while t:
	t = t - 1
	points = []
	(n, m) = map(int, input().split())
	if can_exist(n, m):
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	(x, y) = list(map(int, input().split()))
	if x % y == 0:
		print('YES')
	else:
		print('NO')
	t = t - 1


k = int(input())
for i in range(0, k):
	arr = input().split()
	b = list(map(int, arr))
	c = b[0]
	d = b[1]
	if c % d == 0 or d % c == 0:
		print('YES')
	else:
		print('NO')


def two_regular_polygons():
	a = int(input())
	for i in range(a):
		b = list(map(int, input().split()))
		if b[0] % b[1] == 0:
			print('YES')
		else:
			print('NO')
two_regular_polygons()


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def get_str():
	return input().decode().strip()

def rint():
	return map(int, input().split())

def oint():
	return int(input())
t = oint()
for _ in range(t):
	(n, m) = rint()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


import math
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def factors(num):
	temp = []
	for i in range(3, num + 1):
		if num % i == 0:
			temp.append(i)
	return temp
t_count = int(input().strip())
while t_count > 0:
	(n, m) = list(map(int, input().strip().split(' ')))
	list_0 = factors(n)
	if m in list_0:
		print('YES')
	else:
		print('NO')
	t_count -= 1


for _ in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	print(['NO', 'YES'][a % b == 0])


def check(n, m):
	if n % m == 0:
		return True
	else:
		return False
t = int(input())
while t:
	(n, m) = map(int, input().split())
	if check(n, m):
		print('YES')
	else:
		print('NO')
	t = t - 1


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	if n / k == n // k:
		print('YES')
	else:
		print('NO')


p = int(input())
for x in range(p):
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	if m < n and n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
ans = []
for kek in range(t):
	(a, b) = map(int, input().split())
	if a % b == 0:
		ans.append('YES')
	else:
		ans.append('NO')
print(*ans)


divok = lambda l: l[0] % l[1] == 0
[print('YES' if divok(list(map(int, input().split()))) else 'NO') for _ in range(int(input()))]


import sys
import math
import itertools
from collections import deque

def solve():
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('Yes')
	else:
		print('No')
t = int(input())
for _ in range(t):
	solve()


for i in range(int(input())):
	lis = input().split()
	k = int(lis[0]) / int(lis[-1])
	if int(k) == k:
		print('YES')
	else:
		print('NO')


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		(n, m) = map(int, input().split())
		if n % m == 0:
			print('YES')
		else:
			print('NO')
	q = int(input())
	for _ in range(q):
		solve()
main()


for x in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if a % b == 0:
		print('YES')
	else:
		print('NO')


import sys
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
ni = lambda : int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda : list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda : float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda : list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda : stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda : stdin.readline().split()
t = ni()
for i in range(t):
	(n, m) = na()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = [int(c) for c in input().split()]
	if n % m:
		print('NO')
	else:
		print('YES')


t = int(input())
array = ['NO'] * t
for i in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		array[i] = 'YES'
for i in array:
	print(i)


t = int(input())
for i in ' ' * t:
	(a, b) = [int(i) for i in input().split()]
	(a, b) = (min(a, b), max(a, b))
	if b % a == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	s = [int(x) for x in input().split()]
	if int(s[0] / s[1]) * s[1] == float(s[0]):
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = [int(x) for x in input().split()]
	if n >= 6 and m >= 3 and (n % m == 0):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline

def main():
	for _ in range(int(input())):
		(n, m) = map(int, input().split())
		if n % m == 0:
			print('YES')
		else:
			print('NO')
main()


q = int(input())
for irweewr in range(q):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


mod = 10 ** 9 + 7
import math
from bisect import bisect_left
from collections import Counter
from itertools import combinations

def ain():
	return map(int, input().split())

def fain():
	return map(float, input().split())

def mc2(s):
	return s * (s - 1) // 2 + s
for _ in range(int(input())):
	(n, m) = ain()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	mn = list(map(int, input().split()))
	if mn[0] % mn[1] == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	print(('YES', 'NO')[bool(n % m)])


t = int(input())
for i in range(t):
	(n, m) = tuple(map(int, input().split()))
	if n > m and n % m == 0 or (m > n and m % n == 0) or n == m:
		print('YES')
	elif n % m != 0 or m % n != 0:
		print('NO')


local = False
if local:
	file = open('A.txt', 'r')

def IN():
	if local:
		return file.readline()
	else:
		return input()

def solve(n, m):
	if n % m == 0:
		return 'YES'
	return 'NO'
t = int(IN())
for i in range(t):
	(n, m) = [int(n) for n in IN().split()]
	print(solve(n, m))


test = int(input())
lines = []
for i in range(test):
	line = input()
	lines.append([int(x.strip()) for x in line.split()])
for k in lines:
	if (k[0] - k[1]) % k[1] == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	l = min(a, b)
	k = max(a, b)
	if k % l == 0:
		print('YES')
	else:
		print('NO')


z = input
mod = 10 ** 9 + 7
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)
for _ in range(int(z())):
	(a, b) = map(int, z().split())
	print('YES' if a % b == 0 or b % a == 0 else 'NO')


import math
n = int(input())
c = []
for i in range(n):
	(a, b) = input().split()
	if int(a) % int(b) == 0:
		c.append('YES')
	else:
		c.append('NO')
for i in range(len(c)):
	print(c[i])


import sys
readline = sys.stdin.buffer.readline
T = int(readline())
Ans = [None] * T
for qu in range(T):
	(N, M) = map(int, readline().split())
	Ans[qu] = 'YES' if N % M == 0 else 'NO'
print('\n'.join(Ans))


for i in range(int(input())):
	arr = [int(_) for _ in input().split()]
	if arr[0] % arr[1] == 0:
		print('YES')
	else:
		print('NO')


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	(n, m) = li()
	if not n % m:
		print('YES')
	else:
		print('NO')


from math import *
t = int(input())
mod = 1000000007
for _ in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def main():
	tt = inin()
	for _ in range(tt):
		(n, m) = cin()
		if n % m != 0:
			print('NO')
		else:
			print('YES')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


n = int(input())
I = []
for i in range(n):
	k = [int(i) for i in input().split()]
	I.append(k)
for i in range(n):
	if I[i][1] < 3:
		print('NO')
	elif I[i][0] % I[i][1] == 0:
		print('YES')
	else:
		print('NO')


num_cases = int(input())
for current_case in range(num_cases):
	inp = input()
	inp = inp.split(' ')
	a_vert = int(inp[0])
	b_vert = int(inp[1])
	if a_vert % b_vert == 0:
		print('YES')
	else:
		print('NO')


import math
import os
import random
import re
import sys
t = int(input())
for i in range(t):
	(n, k) = [int(s) for s in input().split(' ')]
	if n % k == 0:
		print('YES')
	else:
		print('NO')


def f():
	(n, m) = input('').split(' ')
	(n, m) = (int(n), int(m))
	if n % m == 0:
		print('YES')
	else:
		print('NO')
n = int(input(''))
for i in range(n):
	f()


for t in range(int(input())):
	(m, n) = map(int, input().split())
	if not m % n:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(n, m) = input().split()
	if int(n) < 3:
		print('NO')
	elif int(n) % int(m) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
while n:
	n -= 1
	(a, b) = map(int, input().split())
	if a < b:
		print('NO')
	elif (a - b) % b == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	X = list(map(int, input().split()))
	if X[0] % X[1] == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	print(['yes', 'no'][n % m != 0])


t = int(input())
while t:
	t -= 1
	l = list(map(int, input().split()))
	if l[0] % l[1] == 0:
		print('YES')
	else:
		print('NO')


test = int(input())
for _ in range(test):
	(n1, n2) = map(int, input().split(' '))
	if n1 % n2 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	l = list((int(ele) for ele in input().split(' ')))
	n = l[0]
	m = l[1]
	if n >= 6 and n % m == 0:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	s = input().split()
	(a, b) = (int(s[0]), int(s[1]))
	if a % b == 0:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
			n = n - 1
		else:
			a = a * a
			n = n >> 1
	return r

def solve():
	(a, b) = mp()
	if a % b == 0:
		pr('YES')
	else:
		pr('NO')
for _ in range(inp()):
	solve()


def solve(n, m):
	if n % m == 0 and n / 2 > 2:
		print('YES')
	else:
		print('NO')
num_iter = int(input())
while num_iter != 0:
	(n, m) = map(int, input().split())
	solve(n, m)
	num_iter -= 1


from sys import stdout, stdin
input = lambda : stdin.readline()
for i in range(int(input())):
	(m, n) = map(int, input().split())
	if (m - n) % n == 0:
		print('YES')
	else:
		print('NO')


def main():
	n = int(input())
	for i in range(n):
		(a, b) = (int(i) for i in input().split())
		if a % b == 0:
			print('YES')
		else:
			print('NO')
main()


import sys

def main():
	i = [int(k) for k in sys.stdin.read().split()]
	for t in range(i[0]):
		(m, n) = (i[2 * t + 1], i[2 * t + 2])
		if m % n == 0 and n >= 3:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
for i in range(t):
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	if a % b == 0:
		print('Yes')
	else:
		print('No')


from math import gcd
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	mn = min(a, b)
	mx = max(a, b)
	g = gcd(a, b)
	l = a * b / g
	if mx == l and mn == g:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	if n < 4:
		print('NO')
	elif m > n:
		print('NO')
	elif n % m == 0:
		print('YES')
	elif n % m != 0:
		print('NO')


import sys
n = int(sys.stdin.readline())
for i in range(n):
	(a, b) = map(int, sys.stdin.readline().split())
	if a % b == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if (a % b == 0 or b % a == 0) and max(a, b) > 2:
		print('YES')
	else:
		print('NO')


import math, sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
li = lambda : list(map(int, input().split()))

def case():
	(n, m) = li()
	if n % m == 0:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	case()


T = int(input())
for i in range(T):
	NM = input()
	[N, M] = NM.split()
	N = int(N)
	M = int(M)
	res = N % M == 0
	print('YES' if res else 'NO')


import sys
read = lambda : list(map(int, sys.stdin.readline().strip().split()))
for _ in range(int(input())):
	(n, m) = read()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


from sys import stdin, setrecursionlimit
from collections import deque
input = stdin.readline
setrecursionlimit(int(200000.0))

def getstr():
	return input()[:-1]

def getint():
	return int(input())

def getints():
	return list(map(int, input().split()))

def getint1():
	return list(map(lambda x: int(x) - 1, input().split()))
jn = lambda x, l: x.join(map(str, l))
MOD = 10 ** 9 + 7
(y, n) = ('YES', 'NO')

def solve():
	(n, m) = list(map(int, input().split()))
	if n % m == 0:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	solve()


for g in [*open(0)][1:]:
	(n, m) = map(int, g.split())
	print('YNEOS'[n % m > 0::2])


test_cases = int(input())
for i in range(test_cases):
	a = input()
	(m, n) = a.split(' ')
	(m, n) = (int(m), int(n))
	if m % n == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if n <= 5 and n == m:
		print('YES')
	elif n <= 5 and n != m:
		print('NO')
	else:
		l = []
		for i in range(3, int(n // 2) + 1):
			if n % i == 0:
				l.append(i)
		l.insert(-1, n)
		if m in l:
			print('YES')
		else:
			print('NO')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	rr = []
	for _ in range(t):
		(n, m) = LI()
		if n % m == 0:
			rr.append('YES')
		else:
			rr.append('NO')
	return JA(rr, '\n')
print(main())


a = int(input())
for _ in range(a):
	mnog = input()
	mnogm = mnog.split()
	if int(mnogm[0]) % int(mnogm[1]) == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(first, sec) = list(map(int, input().split()))
	if first % sec == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
l = []
for i in range(n):
	a = list(map(int, input().strip().split()))[:2]
	if a[0] % a[1] == 0:
		l.append('YES')
	else:
		l.append('NO')
for j in l:
	print(j)


def is_subfigure(n, m):
	if n % m:
		return 'NO'
	return 'YES'
inputs = []
for _ in range(int(input())):
	inputs.append([int(x) for x in input().split()])
for (m, n) in inputs:
	print(is_subfigure(m, n))


import sys

def fastio():
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep=' ', end='\n'):
	print(*var, file=sys.stderr, end=end, sep=sep)
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
(t,) = I()
for test in range(t):
	(n, m) = I()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
m = []
for i in range(t):
	m.append(list(map(int, input().split())))
r = []
for i in m:
	(m, n) = (i[0], i[1])
	if n % m == 0 or m % n == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	val = list(map(int, input().split()))
	(pol1, pol2) = (val[0], val[1])
	if pol1 % pol2 == 0:
		print('YES')
	else:
		print('NO')


def ii():
	return int(input())

def ai():
	return list(map(int, input().split()))

def mi():
	return map(int, input().split())
for _ in range(ii()):
	(n, m) = mi()
	if n % m:
		print('NO')
	else:
		print('YES')


x = int(input())
a = []
for i in range(x):
	(n, m) = map(int, input().split())
	if n % m == 0:
		a.append('YES')
	else:
		a.append('NO')
for i in range(x):
	print(a[i])


banyak = int(input())
array = []
for i in range(banyak):
	array.append([int(i) for i in input().split(' ')])
for i in range(len(array)):
	if array[i][0] % array[i][1] == 0:
		print('yes')
	else:
		print('no')


import math
from collections import defaultdict
x = int(input())
for _ in range(x):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


j = int(input())
for j0 in range(j):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('Yes')
	else:
		print('No')


res = []
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	res.append(['NO', 'YES'][n % m == 0])
print(*res, sep='\n')


n = int(input())
for j in range(n):
	(x, y) = (int(i) for i in input().rsplit())
	if x % y == 0:
		print('YES')
	else:
		print('NO')


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	(a, b) = [int(x) for x in input().split()]
	sys.stdout.write('YES\n' if a % b == 0 else 'NO\n')


n = int(input())
o = []
for i in range(n):
	(k, p) = [int(x) for x in input().split()]
	if k % p == 0:
		o.append('YES')
	else:
		o.append('NO')
for msg in o:
	print(msg)


from sys import stdin, stdout
import math
import heapq
t = 1

def aint():
	return int(input().strip())

def lint():
	return list(map(int, input().split()))

def fint():
	return list(map(int, stdin.readline().split()))

def main():
	(n, m) = lint()
	if n % m == 0:
		print('YES')
	else:
		print('NO')
t = int(input())
for i in range(t):
	main()


import math
t = int(input())
for p in range(t):
	val = list(map(int, input().split()))
	n = val[0]
	m = val[1]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	a = list(map(int, input().split()))
	if a[0] % a[1] == 0:
		print('YES')
		continue
	print('NO')


for hm in range(int(input())):
	(m, n) = map(int, input().split())
	if m % n == 0:
		print('YES')
	else:
		print('NO')


def solver(n, m):
	if n % m == 0:
		return 'YES'
	return 'NO'
N = int(input())
for _ in range(N):
	nm = input().split(' ')
	n = int(nm[0])
	m = int(nm[1])
	print(solver(n, m))


T = int(input())
for t in range(T):
	(N, M) = list(map(int, input().split()))
	if N % M == 0:
		print('YES')
	else:
		print('NO')


exec(int(input()) * "a,b=map(int,input().split());print('YNEOS'[a%b>0::2]);")


t = int(input())
lista = []
listaELE = []
for x in range(t):
	listaELE = list(map(int, input().split(' ')))
	if listaELE[0] % listaELE[1] == 0:
		lista.append('YES')
	else:
		lista.append('NO')
for i in range(len(lista)):
	print(lista[i])


n = int(input())
while n:
	n -= 1
	(a, b) = [int(i) for i in input().split()]
	if a % b == 0:
		print('YES')
	else:
		print('NO')


import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
from functools import lru_cache
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	(n, m) = mapi()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def main():
	testCases = int(input(''))
	for i in range(testCases):
		(n, m) = input('').split()
		m = int(m)
		n = int(n)
		if n % m == 0:
			print('YES')
		else:
			print('NO')
main()


cases = int(input())
for i in range(cases):
	line = input().split(' ')
	n = int(line[0])
	m = int(line[1])
	if n % m == 0:
		print('Yes')
	else:
		print('No')


import math
from sys import *

def solve():
	(n, k) = map(int, input().split())
	print('YES' if n % k == 0 else 'NO')
t = int(input())
while t > 0:
	t -= 1
	solve()


import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def I():
	return list(map(int, input().split()))
for __ in range(int(input())):
	(n, m) = I()
	print('NO') if n % m else print('YES')


def solve(l):
	for i in range(l):
		(m, n) = map(int, input().split())
		if m % n == 0:
			print('Yes')
		else:
			print('No')
solve(int(input()))


import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, m) = list(map(int, input().split()))
	if n % m:
		print('NO')
	else:
		print('YES')


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = 1000000007

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactors(n):
	factors = []
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors.append(i)
			n //= i
		i += 1
	if n > 1:
		factors.append(n)
	return factors

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def main():
	(n, m) = vars()
	res = 'NO'
	if n % m == 0:
		res = 'YES'
	print(res)
t = int(input())
for _ in range(t):
	main()


T = int(input())
for _ in range(T):
	(m, n) = map(int, input().split())
	if m / n == int(m / n):
		print('YES')
	else:
		print('NO')


import math
import sys
import itertools
import itertools

def sa(Type=int):
	return [Type(x) for x in input().split()]

def solve(t):
	(n, m) = sa()
	print('YES' if n % m == 0 else 'NO')
t = int(input())
for i in range(t):
	solve(i + 1)


n = int(input())
l = []
for i in range(n):
	m = list(map(int, input().split()))
	l.append(m)
for i in l:
	if i[0] % i[1] == 0:
		print('yes')
	else:
		print('No')


from functools import reduce
from itertools import combinations
import sys

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(delimiter=' '):
		return input().split(delimiter)

	@staticmethod
	def list_int(delimiter=' '):
		return list(map(int, input().split(delimiter)))

def main():
	t = Read.int()
	for _ in range(t):
		(n, m) = Read.list_int()
		if n % m == 0:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	if n > 5:
		if (n / m).is_integer():
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	m = min(a, b)
	m2 = max(a, b)
	if m2 % m == 0:
		print('YES')
	else:
		print('NO')


R = lambda : list(map(int, input().split()))
for i in [0] * int(input()):
	(n, m) = R()
	print('YES' if not n % m else 'NO')


def solve(n, m):
	if n < m:
		return 'NO'
	if n % m == 0:
		return 'YES'
	return 'NO'
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	r = solve(n, m)
	print(r)


t = int(input())
case = []
for i in range(t):
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	if n % m == 0:
		case.append(0)
	else:
		case.append(1)
for i in range(t):
	if case[i] == 0:
		print('YES')
	else:
		print('NO')


for ctr in range(1, int(input()) + 1):
	(N, M) = map(int, input().split())
	if N % M == 0:
		print('YES')
	else:
		print('NO')


import sys
from collections import defaultdict
import math
import heapq
t = int(sys.stdin.readline())
for _ in range(t):
	(n, m) = map(int, sys.stdin.readline().split())
	(a, b) = (max(n, m), min(n, m))
	if a % b == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	a = input().split()
	a[0] = int(a[0])
	a[1] = int(a[1])
	if a[0] % a[1] == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	(x, y) = (max(a, b), min(a, b))
	if x % y == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(y, z) = map(int, input().split())
	if y % z == 0:
		print('Yes')
	else:
		print('No')


def gcd(a, b):
	return a % b == 0
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if gcd(a, b):
		print('YES')
	else:
		print('NO')


def answer():
	n1 = int(input())
	while n1:
		a = input().split()
		n = int(a[0])
		m = int(a[1])
		if n % m:
			print('NO')
		else:
			print('YES')
		n1 -= 1
answer()


t = int(input())
a = []
for i in range(t):
	(p, s) = map(int, input().split())
	a.append([p, s])
for i in a:
	n = i[0]
	m = i[1]
	if m < 3:
		print('NO')
	elif n % m == 0:
		print('YES')
	else:
		print('NO')


def R():
	return map(int, input().split())

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect
for _ in range(I()):
	(n, m) = R()
	print(['NO', 'YES'][n % m == 0])


n = int(input())
for i in range(n):
	(m, k) = map(int, input().split())
	if m % k == 0 or k % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(big, small) = map(int, input().split())
	if big % small == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(f, g) = map(int, input().split())
	d = f % g
	if d == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	arr = list(map(int, input().split()))
	a = arr[0]
	b = arr[1]
	if a % b == 0:
		print('YES')
	else:
		print('NO')


test = int(input())
for ij in range(test):
	a = list(map(int, input().split()))
	n = a[0]
	m = a[1]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def divisible(n, m):
	return n // m * m == n
x = int(input())
for i in range(x):
	(n, m) = input().split(' ')
	print('YES' if divisible(int(n), int(m)) else 'NO')


n = int(input())
for i in range(n):
	l = list(map(int, input().strip().split(' ')))
	if l[0] % l[1] == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(q, x) = map(int, input().split())
	if q % x:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(n, m) = (int(num) for num in input().split())
	impossible = n % m
	if impossible:
		print('NO')
	else:
		print('YES')


x = int(input())
m = []
for i in range(x):
	y = input()
	l = y.split(' ')
	for u in range(2):
		l[u] = int(l[u])
	if l[0] % l[1] == 0:
		m.append('YES')
	else:
		m.append('NO')
for k in m:
	print(k)


t = int(input())
for i in range(t):
	(s1, s2) = map(int, input().split())
	if s1 % s2 == 0 and s1 > 5:
		print('YES')
	else:
		print('NO')


from math import ceil
test = int(input())
for _ in range(test):
	(n, m) = map(int, input().split())
	if ceil(n / m) != n // m:
		print('NO')
	else:
		print('YES')


def main():
	T = int(input())
	for _ in range(T):
		(N, M) = map(int, input().split())
		if N % M == 0:
			print('YES')
		else:
			print('NO')
main()


def can_create(initial, desired):
	return initial % desired == 0
tests_number = int(input())
for _ in range(tests_number):
	(initial, desired) = map(int, input().split())
	result = can_create(initial, desired)
	print('YES' if result else 'NO')


ans = []
for t in range(int(input())):
	(n, m) = map(int, input().split())
	if n % m:
		ans += ['NO']
	else:
		ans += ['YES']
print('\n'.join(ans))


import sys
f_in = sys.stdin
t = int(f_in.readline())
for i in range(0, t):
	number = f_in.readline().split()
	n = int(number[0])
	m = int(number[1])
	if n % m == 0:
		print('YES')
	else:
		print('NO')


tc = int(input())
for ii in range(tc):
	(n, m) = map(int, input().split())
	if n % m == 0 or m % n == 0:
		print('YES')
	else:
		print('NO')


from collections import Counter
from collections import Counter

def solve():
	(a, b) = list(map(int, input().split()))
	if a % b:
		return 'NO'
	return 'YES'
for i in range(int(input())):
	print(solve())


import io
import os
from collections import defaultdict, deque, Counter

def solve(N, M):
	if N % M == 0 or M % N == 0:
		return 'YES'
	return 'NO'
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N, M) = list(map(int, input().split()))
	ans = solve(N, M)
	print(ans)


t = int(input())
for _ in range(t):
	(N, M) = map(int, input().split())
	if N % M == 0:
		print('YES')
	else:
		print('NO')


def examA():
	T = I()
	ans = []
	for _ in range(T):
		(N, M) = LI()
		if N % M != 0:
			ans.append('NO')
		else:
			ans.append('YES')
	for v in ans:
		print(v)
	return

def examB():
	ans = 0
	print(ans)
	return

def examC():
	ans = 0
	print(ans)
	return

def examD():
	ans = 0
	print(ans)
	return

def examE():
	ans = 0
	print(ans)
	return

def examF():
	ans = 0
	print(ans)
	return
import sys, copy, bisect, itertools, heapq, math, random
from heapq import heappop, heappush, heapify
from collections import Counter, defaultdict, deque

def I():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LSI():
	return list(map(str, sys.stdin.readline().split()))

def LS():
	return sys.stdin.readline().split()

def SI():
	return sys.stdin.readline().strip()
global mod, mod2, inf, alphabet, _ep
mod = 10 ** 9 + 7
mod2 = 998244353
inf = 10 ** 18
_ep = 10 ** (-12)
alphabet = [chr(ord('a') + i) for i in range(26)]
examA()


case = int(input())
for caseNum in range(0, case):
	(a, b) = [int(x) for x in input().split()]
	if a % b == 0:
		print('YES')
	else:
		print('NO')


k = int(input())
for l in range(k):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def main(n, m):
	if n % m == 0:
		print('YES')
	else:
		print('NO')
t = int(input())
a = [list(map(int, input().split())) for _ in range(t)]
for (n, m) in a:
	main(n, m)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(a, b) = [int(i) for i in sys.stdin.readline().split()]
	if a % b == 0:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(m, n) = [int(x) for x in input().split()]
	if m % n == 0:
		print('YES')
		continue
	print('NO')


t = int(input())
while t:
	t -= 1
	(a, b) = [int(i) for i in input().split()]
	if a % b:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if n % k == 0:
		print('Yes')
	else:
		print('NO')


from collections import Counter, deque, defaultdict, OrderedDict, namedtuple
from bisect import bisect_left, bisect_right, insort
from math import sqrt, ceil, floor, factorial, gcd
from sys import stdin
t = int(stdin.readline())
while t:
	t -= 1
	(n, m) = map(int, stdin.readline().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


nb_cases = int(input())
for case in range(nb_cases):
	(n, m) = [int(x) for x in input().split()]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


kl = int(input())
for l in range(kl):
	(n, m) = [int(i) for i in input().split()]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def jn(a, sep='\n'):
	return sep.join(map(str, a))

def solve(n, m):
	if n % m == 0:
		return 'YES'
	return 'NO'

def bruh():
	tests = int(input())
	ans = [0] * tests
	for test in range(tests):
		(n, m) = [int(i) for i in input().split()]
		ans[test] = solve(n, m)
	print(jn(ans))
bruh()


from sys import stdin, stdout
for _ in range(int(input())):
	(n, m) = map(int, stdin.readline().split())
	if n == m:
		print('YES')
	elif m > n:
		print('NO')
	elif n % m == 0 and m > 2:
		print('YES')
	else:
		print('NO')


t = int(input())
i = 1
while i <= t:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	i = i + 1
	if a % b == 0 and a > b and (b > 2):
		print('YES')
	else:
		print('NO')


t = int(input(''))
for i in range(t):
	(n, k) = map(int, input('').split())
	s = []
	for i in range(3, n):
		if n % i == 0:
			s.append(i)
	if k in s:
		print('YES')
	else:
		print('NO')


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
for _ in range(ii()):
	(n, m) = mi()
	print('NO') if n % m else print('YES')


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
MOD = 10 ** 9 + 7
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def solve(n, m):
	if n % m == 0 or m % n == 0:
		return 'YES'
	return 'NO'

def main():
	t = int(input())
	for _ in range(t):
		(n, m) = input().split()
		n = int(n)
		m = int(m)
		print(solve(n, m))
main()


result = [0] * 10001
t = int(input())
for i in range(t):
	a = input().split()
	n = int(a[0])
	m = int(a[1])
	if n % m == 0:
		result[i] = 1
for i in range(t):
	if result[i] == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for u in range(t):
	temp = list(map(int, input().rstrip().split()))
	m = temp[0]
	n = temp[1]
	if m % n == 0:
		print('Yes')
	else:
		print('No')


a = int(input())
for i in range(a):
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	if x % y == 0:
		print('YES')
	if x % y != 0:
		print('NO')


from sys import stdin, stdout
n = int(stdin.readline())
a = []
for i in range(n):
	a.append([int(x) for x in stdin.readline().split()])
for j in range(n):
	if a[j][0] % a[j][1] == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(ni, mi) = map(int, input().split())
	if ni % mi == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(m, k) = map(int, input().split())
	if not m % k:
		print('YES')
	else:
		print('NO')


n = input
i = int
for f in range(i(n())):
	lis = n().split()
	k = i(lis[0]) / i(lis[-1])
	print(['NO', 'YES'][i(k) == k])


from math import *
import sys, random

def nextInt():
	return int(input())

def nextStrs():
	return input().split()

def nextInts():
	return list(map(int, nextStrs()))

def main():
	t = nextInt()
	while t > 0:
		(n, m) = nextInts()
		if n % m == 0:
			print('YES')
		else:
			print('NO')
		t -= 1
exit(main())


length = int(input())
for i in range(length):
	(n, m) = [int(x) for x in input().split()]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input(''))

def test(l):
	(a, b) = (int(l[0]), int(l[1]))
	if a % b == 0:
		return 'YES'
	else:
		return 'NO'
l = []
for i in range(t):
	s = input('').split(' ')
	c = test(s)
	l.append(c)
for j in range(len(l)):
	print(l[j])


t = int(input())
a = []
for i in range(t):
	(N, M) = map(int, input().split())
	a.append([N, M])
for i in a:
	n = i[0]
	m = i[1]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


A = []
T = int(input())
for i in range(T):
	P = [int(x) for x in input().split()]
	A.append(P)
for X in A:
	print('YES' if X[0] % X[1] == 0 else 'NO')


def check(n, m):
	if n % m == 0:
		return print('YES')
	else:
		return print('NO')
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	check(n, m)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	ans = []
	for _ in range(n):
		(a, b) = LI()
		if a % b == 0:
			ans.append('YES')
		else:
			ans.append('NO')
	for x in ans:
		print(x)
main()


tests = int(input())
n = []
m = []
for i in range(0, tests):
	a = list(map(int, input().split()))
	n.append(a[0])
	m.append(a[1])
for i in range(0, tests):
	if m[i] == 2 or m[i] == 1:
		print('NO')
	elif n[i] % m[i] == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
liste = []
for i in range(n):
	(a, b) = input().split(' ')
	liste.append((int(a), int(b)))
for (a, b) in liste:
	if a % b == 0:
		print('YES')
	else:
		print('NO')


from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def solve(s, n, l, r, prefix, k):
	ans = 0
	for i in range(l, r + 1):
		for j in range(i, r + 1):
			ones = prefix[j] - prefix[i - 1]
			zeros = j - i - ones + 1
			if prefix[j] - prefix[i - 1] <= k and zeros <= k:
				ans += 1
	return ans
for _ in range(iinput()):
	(n, m) = rinput()
	print('YES' if n % m == 0 else 'NO')


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())
for _ in range(int(input())):
	(n, m) = get_ints()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = map(int, input().split(' '))
	if max(n, m) % min(m, n):
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a % b == 0:
		print('yes'.upper())
	else:
		print('no'.upper())


from math import gcd
for n in range(int(input())):
	(a, b) = map(int, input().split())
	if a % b != 0:
		print('NO')
	else:
		print('YES')


from collections import Counter
from collections import defaultdict
import math
t = int(input())
for _ in range(0, t):
	(n, m) = list(map(int, input().split()))
	f = 0
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	f = False
	(n, m) = map(int, input().split())
	if n == 5 or n == 3 or n == 4:
		pass
	else:
		for i in range(2, 100):
			if m * i == n:
				f = True
				break
	print('NO' if f is False else 'YES')


t = int(input())
ans_list = []
for i in range(t):
	(a, b) = map(int, input().split())
	if a % b == 0:
		ans_list.append('YES')
	else:
		ans_list.append('NO')
for i in range(t):
	print(ans_list[i])


import sys
line = sys.stdin.read()
t1 = line.split('\n')
t2 = [i.split() for i in t1]
t = []
for i in t2:
	for j in i:
		t.append(int(j))
for i in range(1, t[0] + 1):
	testin = t[i * 2 - 1]
	testout = t[i * 2]
	if testin % testout == 0 and testout >= 3:
		print('YES')
	else:
		print('NO')


ans = ['YES', 'NO']
for t in range(int(input())):
	(n, m) = map(int, input().split())
	print(ans[min(n % m, 1)])


x = 1
x += 1
x = 0
y = x + 1
y = 0
for tin in range(int(input())):
	i = 0
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
t = [list(map(int, input().split())) for x in range(n)]
for (x, y) in t:
	if x % y == 0:
		print('yes')
	else:
		print('no')


w = int(input())
a = []
for i in range(0, w):
	p = input().split()
	a.append(p)
for i in range(0, w):
	r = a[i]
	if int(r[0]) % int(r[1]) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	x = list(map(int, input().rstrip().split()))
	n = x[0]
	m = x[1]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


import sys
import bisect
import heapq
from math import *
from collections import defaultdict as dd
from collections import deque
from collections import Counter as c
from itertools import combinations as comb
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(var)

def l():
	return list(map(int, data().split()))

def sl():
	return list(map(str, data().split()))

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
for _ in range(int(data())):
	(n, m) = sp()
	if n % m == 0:
		out('YES\n')
	else:
		out('NO\n')


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
for _ in range(get_int()):
	(n, m) = get_int_list()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


import sys
(input, print) = (sys.stdin.buffer.readline, sys.stdout.write)
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if (n - m) % m == 0:
		print('YES' + '\n')
	else:
		print('NO' + '\n')


from sys import stdin, stdout
inp = stdin.readline
say = stdout.write
for t in range(int(inp().strip())):
	(n, m) = [int(_) for _ in inp().strip().split()]
	if n % m == 0:
		say('YES\n')
	else:
		say('NO\n')


t = int(input())
while t > 0:
	t = t - 1
	x = input()
	n = int(x.split(' ')[0])
	m = int(x.split(' ')[1])
	if n % m == 0 and n > 5:
		print('YES')
	else:
		print('NO')


from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, itertools, math
sys.setrecursionlimit(10 ** 5)
input = sys.stdin.readline
sqrt = math.sqrt

def LI():
	return list(map(int, input().split()))

def LF():
	return list(map(float, input().split()))

def LI_():
	return list(map(lambda x: int(x) - 1, input().split()))

def II():
	return int(input())

def IF():
	return float(input())

def S():
	return input().rstrip()

def LS():
	return S().split()

def IR(n):
	res = [None] * n
	for i in range(n):
		res[i] = II()
	return res

def LIR(n):
	res = [None] * n
	for i in range(n):
		res[i] = LI()
	return res

def FR(n):
	res = [None] * n
	for i in range(n):
		res[i] = IF()
	return res

def LIR(n):
	res = [None] * n
	for i in range(n):
		res[i] = IF()
	return res

def LIR_(n):
	res = [None] * n
	for i in range(n):
		res[i] = LI_()
	return res

def SR(n):
	res = [None] * n
	for i in range(n):
		res[i] = S()
	return res

def LSR(n):
	res = [None] * n
	for i in range(n):
		res[i] = LS()
	return res
mod = 1000000007
inf = float('INF')

def solve():
	t = II()
	for i in range(t):
		(n, m) = LI()
		print('YES' if n % m == 0 else 'NO')
	return
solve()


import sys
for line in sys.stdin.readlines()[1:]:
	(a, b) = map(int, line.split())
	print('YES' if a % b == 0 else 'NO')


import math

def solve():
	(n, m) = [int(x) for x in input().split(' ')]
	if n % m == 0:
		print('YES')
		return
	print('NO')
	return
t = int(input())
for i in range(t):
	solve()


def main():
	t = int(input())
	while t:
		(n, m) = map(int, input().split())
		if m > n:
			print('NO')
		elif n % m != 0:
			print('NO')
		else:
			print('YES')
		t -= 1
main()


import sys, math, bisect
inf = float('inf')
mod = 10 ** 9 + 7

def lcm(a, b):
	return int(a / math.gcd(a, b) * b)

def gcd(a, b):
	return int(math.gcd(a, b))

def tobinary(n):
	return bin(n)[2:]

def binarySearch(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def lowerBound(a, x):
	i = bisect.bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def upperBound(a, x):
	i = bisect.bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def SieveOfEratosthenes(n):
	ans = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			ans.append(p)
	return ans
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	flag = True
	if n % m != 0:
		flag = False
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for you in range(t):
	l = input().split()
	n = int(l[0])
	m = int(l[1])
	if n % m == 0:
		print('YES')
	else:
		print('NO')


testCases = int(input())
for i1 in range(testCases):
	(n, m) = list(map(int, input().split()))
	if n % m == 0:
		print('YES')
	else:
		print('NO')


for tc in range(int(input())):
	(a, b) = map(int, input().split())
	if a % b:
		print('NO')
	else:
		print('YES')


x = int(input())
for i in range(x):
	angulos = list(map(int, input().split()))
	if angulos[0] % angulos[1] == 0:
		print('YES')
	else:
		print('NO')


import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7

def input():
	return sys.stdin.readline().strip()

def gcd(x, y):
	return y if x % y == 0 else gcd(y, x % y)

def lcm(x, y):
	return x * y // gcd(x, y)

def I():
	return int(input())

def LI():
	return [int(x) for x in input().split()]

def RI(N):
	return [int(input()) for _ in range(N)]

def LRI(N):
	return [[int(x) for x in input().split()] for _ in range(N)]
N = I()
for i in range(N):
	(N, M) = LI()
	print('YES' if N % M == 0 else 'NO')


from sys import stdin

def read():
	return stdin.readline().strip()
t = int(read())
for _ in range(t):
	(a, b) = map(int, read().split())
	print(('NO', 'YES')[a % b == 0])


import math

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	(n, m) = Read.list_int()
	print('YES' if n % m == 0 else 'NO')
query_count = Read.int()
while query_count:
	query_count -= 1
	solve()


a = int(input())
for i in range(a):
	side_input = [int(side) for side in input().split()]
	if side_input[0] % side_input[1] == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	nm = input().split()
	n = int(nm[0])
	m = int(nm[1])
	if max(n, m) % min(n, m) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
ans = ['YES', 'NO']
for i in range(t):
	div = 1
	(n, m) = map(int, input().split())
	if n % m == 0:
		div = 0
	print(ans[div])


a = int(input())
for i in range(a):
	(fig1, fig2) = map(int, input().split())
	if fig1 >= fig2 and fig1 % fig2 == 0:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
for ti in range(int(input())):
	(n, m) = [int(x) for x in input().strip().split()]
	print('YES') if not n % m else print('NO')


from sys import stdin
input()
for line in stdin:
	(n, m) = map(int, line.split())
	print('YES' if n % m == 0 else 'NO')


for x in range(int(input())):
	(h, m) = list(map(int, input().split()))
	if h % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if a % b:
		print('NO')
	else:
		print('YES')


t = int(input())
for v in range(t):
	(a, b) = map(int, input().split())
	m = max(a, b)
	n = min(a, b)
	if m % n == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
ans = []
for _ in range(n):
	(n, m) = map(int, input().split())
	if n % m == 0:
		ans.append('YES')
	else:
		ans.append('NO')
print(*ans, sep='\n')


import sys
input = sys.stdin.readline
Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
for (N, M) in Query:
	print('YES' if N % M == 0 else 'NO')


t = int(input())
for i in range(t):
	(p, q) = input().split(' ')
	p = int(p)
	q = int(q)
	s = p % q
	if s == 0:
		print('YES')
	else:
		print('NO')


def gcd(x, y):
	if y == 0:
		return x
	else:
		return gcd(y, x % y)
t = int(input())
for _ in range(t):
	(u, v) = map(int, input().split())
	if u > v:
		if u % v == 0:
			print('YES')
		else:
			print('NO')
	elif v % u == 0:
		print('YES')
	else:
		print('NO')


while True:
	try:
		t = eval(input())
		for i in range(t):
			(n, m) = map(int, input().split())
			if n % m == 0:
				print('YES')
			else:
				print('NO')
	except:
		break


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, m) = [int(x) for x in input().split()]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


N = int(input())
answers = []
stroka = []
for i in range(N):
	stroka = input().split()
	if int(stroka[0]) % int(stroka[1]) == 0:
		answers.append('YES')
	else:
		answers.append('NO')
for i in range(len(answers)):
	print(answers[i])


import sys
input = sys.stdin.readline

def inp():
	return input()
count = int(inp())
for line in range(count):
	content = inp()
	n = int(content.split()[0])
	m = int(content.split()[1])
	result = 'YES' if n % m == 0 else 'NO'
	print(result)


for _ in range(int(input())):
	print('YNEOS'[bool(divmod(*map(int, input().split()))[1])::2])


import math
import collections
import bisect

def arrPrint(a):
	return ' '.join([str(i) for i in a])

def gridPrint(a):
	return '\n'.join([' '.join([str(j) for j in a[i]]) for i in range(len(a))])

def isPalindrome(s):
	for i in range(len(s) // 2):
		if not s[i] == s[-i - 1]:
			return False
	return True

def primeCheck(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def solve(n, m):
	if n // m > 1 and n % m == 0:
		return 'YES'
	return 'NO'
t = int(input())
for _ in range(t):
	(n, m) = list(map(int, input().split()))
	result = solve(n, m)
	print(result)


t = int(input())
res = ''
for i in range(t):
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	if n % m == 0:
		res += 'YES'
	else:
		res += 'NO'
	res += '\n'
print(res, end='')


t = int(input())
while t > 0:
	(side1, side2) = [int(x) for x in input().split()]
	if side1 % side2 == 0:
		print('YES')
	else:
		print('NO')
	t = t - 1


n = int(input())
results = []
while n > 0:
	intake = str(input()).split(' ')
	firstNum = int(intake[0])
	secondNum = int(intake[1])
	if firstNum % secondNum == 0:
		results.append('YES')
	elif secondNum > firstNum:
		results.append('NO')
	else:
		results.append('NO')
	n -= 1
for element in results:
	print(element)


def solve(n, m):
	if n % m == 0:
		print('YES')
	else:
		print('NO')

def main():
	t = int(input())
	while t != 0:
		nm = input().split()
		solve(int(nm[0]), int(nm[1]))
		t -= 1
main()


def solve():
	(a, b) = map(int, input().split())
	if a % b:
		print('No')
	else:
		print('Yes')
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for ooo in range(t):
	(n, m) = [int(aaa) for aaa in input().split()]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def solve():
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')
t = eval(input())
while t:
	solve()
	t -= 1


c = int(input())
for _ in range(c):
	(n, m) = map(int, input().split())
	(d, f) = (max(n, m), min(n, m))
	if d % f == 0:
		print('YES')
	else:
		print('NO')


from math import *

def binarySearch(arr, x, i):
	l = i
	r = len(arr) - 1
	while l <= r:
		mid = (l + r) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def js(arr, x):
	l = 0
	r = len(arr) - 1
	ans = -1
	while l <= r:
		m = (l + r) // 2
		if arr[m] <= x:
			ans = m
			l = m + 1
		else:
			r = m - 1
	return ans

def jg(arr, x):
	l = 0
	r = len(arr) - 1
	ans = -1
	while l <= r:
		m = (l + r) // 2
		if arr[m] >= x:
			ans = m
			r = m - 1
		else:
			l = m + 1
	return ans
for __ in range(int(input())):
	(a, b) = map(int, input().split())
	if a % b == 0:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def getStr():
	return input().strip()
t = getInt()
for _ in range(t):
	(n, m) = getVars()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


from math import *
from sys import *
t = int(stdin.readline())
for i in range(t):
	(n, k) = map(int, stdin.readline().split())
	if n % k == 0:
		print('YES')
	else:
		print('NO')


k = int(input())
for i in range(k):
	a = list(map(int, input().split()))
	if a[0] % a[1] == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a % b == 0:
		print('Yes')
	else:
		print('No')


import math
t = int(input(''))
while t > 0:
	(n, m) = input('').split()
	n = int(n)
	m = int(m)
	if n % m == 0:
		print('YES')
	else:
		print('NO')
	t = t - 1


def convex(n, y):
	return n % y == 0
t = int(input())
for i in range(t):
	(x, p) = input().split()
	if convex(int(x), int(p)):
		print('YES')
	else:
		print('NO')


def get(*arg):
	if arg[0] == 0:
		cnt = int(input())
		flag = 1
	else:
		cnt = 1
		flag = 0
	lst = list()
	for i in range(cnt):
		lst2 = list()
		for ii in range(len(arg) - flag):
			if arg[ii + flag] == 1:
				t = input().split()
				tmp = list()
				for iii in t:
					tmp.append(int(iii))
			elif arg[ii + flag] == 2:
				tmp = input().split()
			else:
				tmp = input()
			lst2.append(tmp)
		lst.append(lst2)
	return lst
a = get(0, 1)
for i in a:
	if i[0][0] % i[0][1] == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for kase in range(t):
	(n, m) = tuple(map(int, input().split(' ')))
	if n % m == 0:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline

def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	return divisors

def main():
	t = int(input())
	for _ in range(t):
		(N, M) = [int(x) for x in input().split()]
		divs = set(make_divisors(N))
		if M in divs:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
a = []
b = []
for i in range(t):
	(n, m) = [int(n) for n in input().split()]
	a.append(n)
	b.append(m)
for j in range(t):
	if a[j] % b[j] == 0:
		print('Yes')
	else:
		print('No')


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	(n, m) = [int(i) for i in stdin.readline().split()]
	if n % m == 0:
		stdout.write('YES\n')
	else:
		stdout.write('NO\n')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split(' '))
	if a >= 3 and b >= 3:
		if a % b == 0:
			print('YES')
		else:
			print('NO')


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
from io import BytesIO, IOBase
from bisect import bisect_left as bl
from bisect import bisect_right as br

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def modpow(b, p, m):
	res = 1
	b = b % m
	while p:
		if p & 1:
			res = res * b % m
		b = b * b % m
		p >>= 1
	return res

def mod_inv(a, m):
	return modpow(a, m - 2, m)

def ncr(n, r, m):
	res = 1
	if r == 0:
		return 1
	if n - r < r:
		r = n - r
	(p, k) = (1, 1)
	while r:
		res = res % m * (n % m * mod_inv(r, m) % m) % m
		n -= 1
		r -= 1
	return res

def ncrlis(n, r, m, fact):
	return fact[n] * (mod_inv(fact[r], m) * mod_inv(fact[n - r], m)) % m % m

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(ii()):
	(n, m) = mi()
	print('YES' if n % m == 0 else 'NO')


n = int(input())
for i in range(n):
	(n1, k) = map(int, input().split())
	if k <= 2:
		print('NO')
	elif n1 % k == 0:
		print('YES')
	else:
		print('NO')


import sys
from sys import stdout, stdin
import math

def inputt():
	return stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return input().split()

def rlinput():
	return [int(i) for i in input().split()]

def main():
	(n, m) = rlinput()
	if n % m == 0 and n > m:
		print('YES')
	else:
		print('NO')
for i in range(iinput()):
	main()


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	f = False
	for x in range(2, 100):
		if x * m == n:
			f = True
			break
	print('YES') if f else print('NO')


t = int(input())
t1 = t
nn = []
mn = []
while t != 0:
	(n, m) = list(map(int, input().split(' ')))
	nn.append(n)
	mn.append(m)
	t -= 1
for i in range(t1):
	if nn[i] % mn[i] == 0:
		print('YES')
	else:
		print('NO')


def solution(m, n):
	if n % m == 0:
		return 'YES'
	else:
		return 'NO'
t = int(input())
while t > 0:
	(n, m) = [int(x) for x in input().split()]
	S = solution(m, n)
	print(S)
	t -= 1


import sys
first = 1
from math import gcd
for line in sys.stdin:
	values = list(map(int, line.split()))
	if first == 1:
		first = 0
		continue
	(a, b) = values
	g = gcd(a, b)
	if g == min(a, b):
		print('YES')
	else:
		print('NO')


def rint():
	return int(input())

def rlint():
	return [int(i) for i in input().split()]
t = rint()
for _ in range(t):
	(n, m) = rlint()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	(a, b) = tuple(input().split(' '))
	(a, b) = (int(a), int(b))
	(a, b) = (max(a, b), min(a, b))
	if a % b == 0:
		print('YES')
	else:
		print('NO')


def prim(a, b):
	while b != 0:
		c = a % b
		a = b
		b = c
	return a
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	if a % b == 0:
		print('YES')
	else:
		print('NO')


def solve(n, m):
	return 'YES' if not n % m else 'NO'

def main():
	inp = lambda : [int(x) for x in input().split()]
	tc = int(input())
	for _ in range(tc):
		(n, m) = inp()
		print(solve(n, m))
main()


t = int(input())
for i in range(t):
	a = list(map(int, input().split(' ')))
	print(('NO', 'YES')[a[0] % a[1] == 0 or a[1] % a[0] == 0])


import math
n = int(input())
for t in range(n):
	a = list(map(int, input().split()))
	if a[0] % a[1] == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
s = []
for hfvjv in range(0, t):
	x = input()
	xx = x.split()
	n = int(xx[0])
	m = int(xx[1])
	if n % m == 0:
		s.append('YES')
	else:
		s.append('NO')
for i in s:
	print(i)


for _ in [0] * int(input()):
	(n, m) = map(int, input().split())
	print('YNEOS'[n % m > 0::2])


t = int(input())
n_list = []
m_list = []
for i in range(1, t + 1):
	(n, m) = (int(value) for value in input().split())
	n_list.append(n)
	m_list.append(m)
for index in range(t):
	if n_list[index] % m_list[index] == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(N, M) = [int(x) for x in input().split()]
	print('YES' if N % M == 0 else 'NO')


def solve():
	T = int(input())
	for i in range(T):
		(n, m) = map(int, input().split())
		if n % m:
			print('NO')
		else:
			print('YES')
solve()


import sys
import math
import bisect

def main():
	for _ in range(int(input())):
		(n, m) = map(int, input().split())
		if n % m == 0:
			print('YES')
		else:
			print('NO')
main()


for _ in range(int(input())):
	(n, mm) = map(int, input().split())
	print(('YES', 'NO')[n % mm > 0])


def solved(n, m):
	if n % m == 0:
		return 'YES'
	return 'NO'
n = int(input())
while n > 0:
	(x, y) = map(int, input().split())
	print(solved(x, y))
	n -= 1


import sys
T = int(sys.stdin.readline())
for i in range(T):
	(a, b) = map(int, sys.stdin.readline().split())
	if max(a, b) % min(a, b) == 0:
		print('YES')
	else:
		print('NO')


I = input
x = {True: 'YES', False: 'NO'}
for _ in range(int(I())):
	(a, b) = list(map(int, I().split()))
	print(x[a % b == 0])


for ioi in range(int(input())):
	(nn, m) = map(int, input().split())
	if nn % m == 0:
		print('YES')
	else:
		print('NO')


from sys import stdin

def main():
	t = int(stdin.readline().strip())
	for _ in range(t):
		(n, m) = map(int, stdin.readline().strip().split())
		print('YES' if n % m == 0 else 'NO')
main()


for t in range(int(input())):
	(l, m) = map(int, input().split())
	if l % m == 0 and m >= 3:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(1, n + 1):
	(a, b) = [int(x) for x in input().split(' ')]
	if a % b == 0:
		print('YES')
	else:
		print('NO')


l = int(input())
for i in range(l):
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	if x % y == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(x, y) = map(int, input().split())
	if y < 3 or x % y:
		print('NO')
	else:
		print('YES')


T = int(input())
while T > 0:
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('No')
	T -= 1


test_case = int(input())
i = 0
while i < test_case:
	i += 1
	(a, b) = input().split()
	if int(a) % int(b) == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	if (m - 2) * 180 / m >= 180:
		print('NO')
		continue
	if n % m != 0:
		print('NO')
		continue
	print('YES')


t = int(input())
for i in range(t):
	n = input().split()
	(n[0], n[1]) = (int(n[0]), int(n[1]))
	if n[0] % n[1] == 0:
		print('YES')
		continue
	print('NO')


from math import gcd
t = int(input())
for tt in range(t):
	(a, b) = map(int, input().split())
	if a % b == 0 or b % a == 0:
		print('YES')
	else:
		print('NO')


import sys

def input():
	return sys.stdin.readline().rstrip('\r\n')
for case in range(int(input())):
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')


test_cases = int(input())
for cases in range(test_cases):
	(n, m) = input().split(' ')
	(n, m) = (int(n), int(m))
	if n % m == 0:
		print('YES')
	else:
		print('NO')


num = int(input())
for i in range(num):
	side = input()
	side = side.split(' ')
	a = int(side[0])
	b = int(side[1])
	if a % b == 0 or b % a == 0:
		print('YES')
	else:
		print('NO')


num_tests = int(input())
tests = []
for i in range(num_tests):
	tests.append(input().split(' '))
for test in tests:
	print('YES') if int(test[0]) % int(test[1]) == 0 else print('NO')


t = int(input())

def solve(ta, tb):
	if ta % tb == 0:
		return 1
	else:
		return 0
ans = []
for _ in range(t):
	(ta, tb) = map(int, input().split())
	ans.append(solve(ta, tb))
for a in ans:
	if a:
		print('YES')
	else:
		print('NO')


from sys import stdin

def main():
	r = stdin.readline
	cases = int(r())
	for case in range(cases):
		(a, b) = map(int, r().strip().split())
		print('NO' if a % b != 0 else 'YES')
main()


n = int(input())
for i in range(n):
	a = list(map(int, input().strip().split()))
	c = 0
	for i in range(1, a[0]):
		if a[0] == i * a[1]:
			c += 1
	if c == 0:
		print('NO')
	if c >= 1:
		print('YES')


tests = [[int(i) for i in input().split()] for j in range(int(input()))]
for test in tests:
	print('YES' if test[0] % test[1] == 0 else 'NO')


import math
import itertools
gh = lambda : map(int, input().split())
N = 2 * 10000000.0 + 5
N = int(N)

def main():
	t = int(input())
	while t:
		t -= 1
		(n, m) = gh()
		print('YNEOS'[n % m != 0::2])
main()


import math, collections, sys
input = sys.stdin.readline

def solve():
	(n, m) = map(int, input().split())
	if n % m:
		print('NO')
	else:
		print('YES')
for _ in range(int(input())):
	solve()


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	(n, m) = read()
	if n % m == 0:
		print('YES')
	else:
		print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = scanner()
for i in range(t):
	solve()


n = int(input())
arr = []
for i in range(n):
	arr.append([int(i) for i in input().split()])
for i in arr:
	if i[0] % i[1] == 0:
		print('YES')
	else:
		print('NO')


import sys
t = int(sys.stdin.readline())
for i in range(t):
	nm = sys.stdin.readline().split()
	if int(nm[0]) % int(nm[1]) == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	l = [int(x) for x in input().split()]
	n1 = l[0]
	n2 = l[1]
	if n1 % n2 == 0:
		print('YES')
	else:
		print('NO')


import sys
from collections import Counter

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(N, M) = MAP()
	if N % M == 0:
		YES()
	else:
		NO()


t = int(input())
while t > 0:
	t -= 1
	line = input().split(' ')
	n = int(line[0])
	m = int(line[1])
	if n == m or n % m == 0:
		print('YES')
		continue
	print('NO')


def polygon():
	cases = int(input())
	size = []
	for i in range(cases):
		size.append(input().split())
	for i in range(len(size)):
		if int(size[i][1]) >= int(size[i][0]) - 1:
			print('NO')
		elif int(size[i][0]) % int(size[i][1]) != 0:
			print('NO')
		else:
			print('YES')
polygon()


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	res = str('YES') if n % m == 0 else str('NO')
	print(res)


b = ['YES', 'NO']
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	print(b[min(n % m, 1)])


import sys
RI = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
for _ in range(int(ri())):
	(a, b) = RI()
	if a % b == 0:
		print('YES')
	else:
		print('NO')


a = int(input())
for i in range(a):
	(x, y) = map(int, input().split())
	if x % y == 0 and y <= x:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(a, b) = [int(x) for x in input().split()]
	if a % b == 0 or b % a == 0:
		print('YES')
	else:
		print('NO')


import sys

def solve():
	numList = list(map(int, input().split()))
	if numList[0] % numList[1] == 0:
		print('YES')
	else:
		print('NO')
t = int(input())
for i in range(t):
	solve()


from sys import stdin
t = int(stdin.readline())
for i in range(t):
	(n, m) = list(map(int, stdin.readline().split(' ')))
	if n % m == 0:
		print('YES')
	else:
		print('NO')


I = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	(n, m) = I()
	print('YES') if n % m == 0 else print('NO')


t = int(input())
for i in range(t):
	temp = [int(x) for x in input().split()]
	n = temp[0]
	m = temp[1]
	if n % m == 0:
		print('YES')
	else:
		print('NO')


def two_regular_polygons(n: int, m: int) -> str:
	if n % m == 0:
		return 'YES'
	return 'NO'
t = int(input())
polygons = []
for i in range(t):
	(n, m) = input().split()
	polygons.append([int(n), int(m)])
for i in range(t):
	(n, m) = polygons[i]
	print(two_regular_polygons(n, m))


import math

def dtb(n):
	return bin(n).replace('0b', '')

def btd(n):
	return int(n, 2)
t = int(input())
for k in range(t):
	(n, m) = map(int, input().split())
	if n <= 5:
		print('NO')
		continue
	if n % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
b = []
for i in range(t):
	[n, m] = [int(x) for x in input().split()]
	b.append('YES' if n % m == 0 else 'NO')
for i in b:
	print(i)


a = int(input())
for i in range(a):
	l = list(map(int, input().split()))
	b = sorted(l)
	if b[1] % b[0] == 0:
		print('YES')
	else:
		print('NO')


c = int(input())
for _ in range(c):
	(a, b) = reversed(sorted(list(map(int, input().split()))))
	if a % b == 0:
		print('YES')
	else:
		print('NO')


testes = int(input())
for t in range(testes):
	ent = input().split(' ')
	vertices = int(ent[0])
	novo = int(ent[1])
	if vertices % novo == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(n1, n2) = map(int, input().split())
	if n1 % n2 == 0 or n2 % n1 == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
while n:
	l1 = [int(i) for i in input().split()]
	if l1[0] % l1[1] == 0:
		print('YES')
	else:
		print('NO')
	n -= 1


a = int(input())
arr = []
for i in range(a):
	b = [int(g) for g in str(input()).split()]
	if b[0] % b[1] == 0:
		arr.append('YES')
	else:
		arr.append('NO')
for k in arr:
	print(k)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def so():
	return int(input())

def st():
	return input()

def mj():
	return map(int, input().strip().split(' '))

def msj():
	return map(str, input().strip().split(' '))

def le():
	return list(map(int, input().split()))

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	for i in range(so()):
		(a, b) = mj()
		if a % b == 0:
			print('YES')
		else:
			print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


try:
	for _ in range(int(input())):
		(n, m) = map(int, input().split())
		if n % m == 0:
			print('YES')
		else:
			print('NO')
except:
	pass


def I():
	return map(int, input().split())
for _ in range(int(input())):
	(n, m) = I()
	print('YNEOS'[n % m != 0::2])


from sys import stdin

def read_tuple():
	return map(int, input().split())

def read_int():
	return int(input())

def read_list():
	return list(map(int, input().split()))

def read_str_list():
	return list(input().split())
for _ in range(read_int()):
	(n, m) = read_tuple()
	if n % m == 0:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
int_in = lambda : int(stdin.readline())
arr_in = lambda : [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda : stdin.readline().strip()
out = lambda o: stdout.write('{}\n'.format(o))
arr_out = lambda o: out(' '.join(map(str, o)))
bool_out = lambda o: out('YES' if o else 'NO')

def solve(n, m):
	return n % m == 0
for i in range(int_in()):
	(n, m) = arr_in()
	bool_out(solve(n, m))


import math

def main():
	(n, m) = map(int, input().split())
	if n % m == 0:
		print('YES')
	else:
		print('NO')
t = int(input())
for i in range(t):
	main()


tests = int(input())
for i in range(tests):
	in_str = input().split(' ')
	tupl = (int(in_str[0]), int(in_str[1]))
	print('YES' if tupl[0] % tupl[1] == 0 else 'NO')


times = int(input())
answer = list()
for i in range(times):
	(a, b) = map(int, input().split())
	if a % b == 0:
		answer.append('YES')
	else:
		answer.append('NO')
for i in answer:
	print(i)


import sys

def div(arr):
	if arr[0] % arr[1] == 0:
		print('YES')
	else:
		print('NO')
userInput = sys.stdin.readlines()
strLen = int(userInput[0].rstrip())
for i in range(1, strLen + 1):
	div(list(map(int, userInput[i].rstrip().split())))