#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  vector<string> v;
  for (int i = 0; i < t; i++) {
    int n, m;
    cin >> n >> m;
    if (n % m == 0)
      v.push_back("YES");
    else
      v.push_back("NO");
  }
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << '\n';
  }
  return 0;
}
