#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a, b;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    long long c = a - b;
    if (c == 1)
      cout << "NO"
           << "\n";
    else
      cout << "YES"
           << "\n";
  }
}
