#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  clock_t clk = clock();
  cerr << "I will return...\n";
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    if (n % m == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  cerr << "...no matter what.\n";
  cerr << "Time (in ms): " << double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC
       << '\n';
}
