#include <bits/stdc++.h>
using namespace std;
int N, M;
int a[300005];
int main() {
  ios::sync_with_stdio(0);
  int T;
  cin >> T;
  while (T--) {
    cin >> N >> M;
    if (N % M == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
