#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int n, m;
    cin >> n >> m;
    if (n % m == 0)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
