#include <bits/stdc++.h>
using namespace std;
using llu = unsigned long long int;
void solve() {
  long long int n, m;
  cin >> n >> m;
  if (n % m)
    cout << "NO\n";
  else
    cout << "YES\n";
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  llu TestCases;
  cin >> TestCases;
  while (TestCases--) solve();
  return 0;
}
