#include <bits/stdc++.h>
using namespace std;
bool convex(int n, int m) {
  if (n % m == 0) return true;
  return false;
}
int main(int argc, char const *argv[]) {
  int t, m, n;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    if (convex(n, m)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
