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