#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (a > 0 && b > 0)
    if (a > b)
      a %= b;
    else
      b %= a;
  return a + b;
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
int grid[1003][1003];
long long fast_exp(long long n, long long k) {
  if (k == 0) return 1;
  if (k == 1) return n;
  long long temp = fast_exp(n, k >> 1);
  if ((k & 1) == 1) return (n * temp * temp) % 1000000007;
  return (temp * temp) % 1000000007;
}
long long isprime(long long i) {
  if (i == 2 || i == 3) {
    return 0;
  }
  bool ctr = 0;
  for (long long k = 2; k * k < i; k++) {
    if (i % k == 0) ctr = 1;
  }
  if (ctr)
    return 1;
  else
    return 0;
}
double x1, x2, y11, y2, v1, v2;
double timet = 0;
double f(double dd) {
  timet = 0;
  timet += sqrt(((dd - x1) * (dd - x1) + (0 - y11) * (0 - y11))) / v1;
  timet += sqrt(((dd - x2) * (dd - x2) + (0 - y2) * (0 - y2))) / v2;
  return timet;
}
double tesearch(double left, double right, double eps = 1e-7) {
  while (right - left > eps) {
    double mid1 = left + (right - left) / 3;
    double mid2 = right - (right - left) / 3;
    if (f(mid1) > f(mid2)) {
      left = mid1;
    } else {
      right = mid2;
    }
  }
  return f(left);
}
int main() {
  long long x, y;
  long long n;
  scanf("%lld", &n);
  for (int a = 0; a < n; a++) {
    scanf("%lld %lld", &x, &y);
    if (x - y > 1) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
