#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
int a[maxn], b[maxn];
const int inf = 0x6f6f6f6f;
int T;
int n, m, k;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &n, &m);
    if (n % m == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
