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