#include <bits/stdc++.h>
int main() {
  int t, l, m, n;
  scanf("%d", &t);
  for (l = 1; l <= t; l++) {
    scanf("%d%d", &n, &m);
    if (n % m == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
