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