#include <bits/stdc++.h>
using namespace std;
bool isprime(long long int n) {
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int64_t mul(int a, int64_t b) {
  if (b == 0) return 1;
  int64_t res = mul(a, b / 2);
  if (b % 2)
    return res * res * a;
  else
    return res * res;
}
void solve() {
  int n, m;
  cin >> n >> m;
  if (n % m == 0) {
    cout << "YES"
         << "\n";
    return;
  }
  cout << "NO"
       << "\n";
  return;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
