#include <bits/stdc++.h>
using namespace std;
bool prime(long long int x) {
  long long int p = 0;
  for (long long int i = 2; (i * i <= x && p == 0); i++) {
    if (x % i == 0) p++;
  }
  return (p == 0);
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b;
    cin >> a >> b;
    a = a - b;
    if (a == 1)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
