#include <bits/stdc++.h>
#pragma GCC optimize "trapv"
const int inf1 = 1e9;
const long long int inf2 = 1e18;
const int N = 100000;
using namespace std;
int dirs[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
int solve() {
  int n, m;
  cin >> n >> m;
  if (n % m == 0)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
