#include <bits/stdc++.h>
using namespace std;
int T;
long long x, y;
long long tmp;
int main() {
  cin >> T;
  while (T--) {
    cin >> x >> y;
    tmp = x - y;
    if (tmp != 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
