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