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