#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  long long a, b;
  int t;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    if (n == m) {
      cout << "YES" << endl;
    } else {
      a = n % (m);
      b = (m) / 2;
      if (a > b)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
