#include <bits/stdc++.h>
using namespace std;
int p[100000];
vector<int> v;
void sieve() {
  memset(p, 1, sizeof p);
  for (int i = 2; i < (50000); i += 2) p[i] = 0;
  v.push_back(2);
  for (int i = 3; i <= sqrt(50000); i += 2) {
    if (p[i]) {
      for (int j = 2; i * j <= (50000); j++) p[i * j] = 0;
    }
  }
  for (int i = 2; i < 50000; i++) {
    if (p[i]) v.push_back(i);
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x, y;
    cin >> x >> y;
    long long dif = x - y;
    if (dif == 1)
      cout << "no" << endl;
    else {
      cout << "yes" << endl;
    }
  }
  return 0;
}
