#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t;
  cin >> t;
  unsigned long long x, y, z;
  while (t--) {
    cin >> x >> y;
    z = x - y;
    if (z == 1)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
