def is_eq_book(childrens, books):
if books < childrens: return 'NO'
if books == childrens: return 'YES'
if books % childrens == 0:
return 'YES'
return 'NO'
if __name__ == '__main__':
n = int(input())
for i in range(n):
[childrens, books] = list(map(int, input().split()))
print(is_eq_book(childrens, books))
ZGVmIGlzX2VxX2Jvb2soY2hpbGRyZW5zLCBib29rcyk6CiAgICBpZiBib29rcyA8IGNoaWxkcmVuczogcmV0dXJuICdOTycKICAgIGlmIGJvb2tzID09IGNoaWxkcmVuczogcmV0dXJuICdZRVMnCiAgICBpZiBib29rcyAlIGNoaWxkcmVucyA9PSAwOgogICAgICAgIHJldHVybiAnWUVTJwogICAgcmV0dXJuICdOTycKCmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6CgluID0gaW50KGlucHV0KCkpCgkKCWZvciBpIGluIHJhbmdlKG4pOgoJCVtjaGlsZHJlbnMsIGJvb2tzXSA9IGxpc3QobWFwKGludCwgaW5wdXQoKS5zcGxpdCgpKSkKCQlwcmludChpc19lcV9ib29rKGNoaWxkcmVucywgYm9va3MpKQoJCQ==