#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 1;
int main() {
  if (!0) {
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
  };
  int t;
  cin >> t;
  while (t--) {
    int a, b;
    cin >> a >> b;
    cout << (a % b == 0 ? "YES" : "NO") << '\n';
  }
}
