#include <bits/stdc++.h>
using namespace std;
signed main() {
  std::ios::sync_with_stdio(false);
  long long 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;
}
