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