#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    if (x - y >= 2)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
