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