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