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