#include <bits/stdc++.h>
using namespace std;
long long zero = 0, one = 0, two = 0;
string s;
unsigned long long u, v;
unsigned long long n, m;
void input() { cin >> n >> m; }
void solve() {
  if (n % m == 0) {
    cout << "YES";
  } else
    cout << "NO";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  unsigned long long T = 1;
  cin >> T;
  while (T--) {
    input();
    solve();
    cout << endl;
  }
}
