#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15 + 10;
const long double pi = 3.141592653589793238;
long long MOD = 1000000007;
const long long N = 5e5 + 10;
long long n, m;
void solve() {
  cin >> n >> m;
  cout << (n % m == 0 ? "YES" : "NO") << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
