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