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