#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream &operator>>(istream &in, vector<T> &arr) {
  for (auto &el : arr) {
    in >> el;
  }
  return in;
}
template <typename T, typename TT>
istream &operator>>(istream &in, pair<T, TT> &pp) {
  in >> pp.first >> pp.second;
  return in;
}
template <typename T>
ostream &operator<<(ostream &out, vector<T> &arr) {
  for (auto &el : arr) {
    out << el << " ";
  }
  return out;
}
template <typename T, typename TT>
ostream &operator<<(ostream &out, pair<T, TT> &pp) {
  out << pp.first << " " << pp.second;
  return out;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x, y;
    cin >> x >> y;
    if (abs(x - y) != 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
