#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int t;
  cin >> t;
  while (t--) {
    long long x, y;
    cin >> x >> y;
    long long tmp = x - y;
    cout << (tmp > 1 ? "YES" : "NO") << endl;
  }
  return 0;
}
