#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  cin >> num;
  while (num--) {
    int a, b;
    cin >> a >> b;
    if (a <= b)
      cout << "NO" << endl;
    else {
      if (a % b == 0)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
