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