#include <bits/stdc++.h>
using namespace std;
 
void mainSolve()
{
  int n,x;
  cin >>n>>x;

  cout<< ((x%n==0)?"YES":"NO") ;
  cout<<endl;
  
}
 
int main()
{
  int t;
  cin >> t;
  while (t--)
  {
    mainSolve();
  }
  return 0;
}