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