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