#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  unsigned long long num, res = 0, tests;
  cin >> tests;
  for (long long i = 0; i < tests; ++i) {
    long long n, m;
    cin >> n >> m;
    if (n % m == 0) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
      ;
    }
  }
}
