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