#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    unsigned long long x, y;
    cin >> x >> y;
    if (x - y == 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
