#include <bits/stdc++.h>
using namespace std;
long long t;
int main() {
  scanf("%I64d", &t);
  for (long long i = 1; i <= t; i++) {
    long long x, y;
    scanf("%I64d%I64d", &x, &y);
    if (x - y == 1)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
