#include <bits/stdc++.h>
using namespace std;
void test_case() {
  long long int n, m;
  cin >> n >> m;
  if (n % m == 0)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) test_case();
  return 0;
}
