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