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