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