#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double PI = 3.141592653589793238463;
const int MAXN = 2e5 + 5;
long long fastPow(long long x, long long b) {
  if (b == 0)
    return 1;
  else if (!(b & 1)) {
    return fastPow(x * x, b / 2);
  } else
    return x * fastPow(x * x, (b - 1) / 2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    if (n % m == 0)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
  return 0;
}
