#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  if (n % m == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
  return;
}
signed main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) solve();
  return 0;
}
