#include <bits/stdc++.h>
using namespace std;
const int tp0 = 1;
const int tp1 = 10;
const int tp2 = 107;
const int tp3 = 1000;
const int tp4 = 10000;
const int tp5 = 100009;
const int tp6 = 1000000;
const int tp7 = 10000000;
const int tp8 = 100000000;
const int tp9 = 1000000000;
const int mod = 1000000007;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    if (x - y == 1)
      cout << "NO";
    else
      cout << "YES";
    cout << endl;
  }
}
