#include <bits/stdc++.h>
using namespace std;
long long int isvalid(long long int s) {
  float k = (-1 + sqrt(1 + 8 * s)) / 2;
  return ceil(k);
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int x, y;
    cin >> x >> y;
    if (abs(x - y) == 1) {
      cout << "NO";
    } else {
      cout << "YES";
    }
    cout << endl;
  }
}
