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