#include <bits/stdc++.h>
using namespace std;
string repeat(string second, int n) {
  string s1 = "";
  for (int i = 0; i < n; i++) s1 += second;
  return s1;
}
string getString(char x) {
  string second(1, x);
  return second;
}
void optimizeIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
void solve() {
  int a, b;
  cin >> a >> b;
  if (a % b == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  optimizeIO();
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
