#include <bits/stdc++.h>
using namespace std;
int main() {
  int test, i;
  scanf("%d", &test);
  while (test--) {
    int n, m;
    scanf("%d%d", &n, &m);
    if (n > m && (n % m) == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
