You are given two integers $x$ and $y$ (it is guaranteed that $x > y$). You may choose any prime integer $p$ and subtract it any number of times from $x$. Is it possible to make $x$ equal to $y$?

Recall that a prime number is a positive integer that has exactly two positive divisors: $1$ and this integer itself. The sequence of prime numbers starts with $2$, $3$, $5$, $7$, $11$.

Your program should solve $t$ independent test cases.


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 1000$) — the number of test cases.

Then $t$ lines follow, each describing a test case. Each line contains two integers $x$ and $y$ ($1 \le y < x \le 10^{18}$).


-----Output-----

For each test case, print YES if it is possible to choose a prime number $p$ and subtract it any number of times from $x$ so that $x$ becomes equal to $y$. Otherwise, print NO.

You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes, and YES will all be recognized as positive answer).


-----Example-----
Input
4
100 98
42 32
1000000000000000000 1
41 40

Output
YES
YES
YES
NO



-----Note-----

In the first test of the example you may choose $p = 2$ and subtract it once.

In the second test of the example you may choose $p = 5$ and subtract it twice. Note that you cannot choose $p = 7$, subtract it, then choose $p = 3$ and subtract it again.

In the third test of the example you may choose $p = 3$ and subtract it $333333333333333333$ times.

Difficulty: EASY

Solutions:
t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	a = x - y
	if a > 1:
		print('YES')
	else:
		print('NO')


t = int(input())
ls = []
for i in range(t):
	(x, y) = map(int, input().split())
	if x - y == 1:
		ls.append('NO')
	else:
		ls.append('YES')
for c in ls:
	print(c)


t = int(input())
while t > 0:
	t -= 1
	(x, y) = map(int, input().split())
	if x - y == 1:
		print('NO')
	else:
		print('YES')


T = int(input())
for t in range(T):
	(a, b) = map(int, input().strip().split(' '))
	if a - b == 1:
		print('NO')
	else:
		print('YES')


def main():
	t = int(input())
	for _ in range(t):
		(x, y) = map(int, input().strip().split())
		if x - y == 1:
			print('NO')
		else:
			print('YES')
main()


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a - b <= 1:
		print('NO')
	else:
		print('YES')


from collections import defaultdict as DD
from bisect import bisect_left as BL
from bisect import bisect_right as BR
from itertools import combinations as IC
from itertools import permutations as IP
from random import randint as RI
import sys
MOD = pow(10, 9) + 7

def IN(f=0):
	if f == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
tc = IN(1)
for _ in range(tc):
	(x, y) = IN()
	if x == y + 1:
		print('NO')
	else:
		print('YES')


n = int(input())
j = []

def judge(a, b):
	diff = a - b
	return 'YES' if diff != 1 else 'NO'
for i in range(n):
	(a, b) = map(int, input().split(' '))
	j.append(judge(a, b))
print('\n'.join(j))


num = int(input())
for i in range(num):
	(x, y) = [int(i.strip()) for i in input().split(' ')]
	if x - y == 1:
		print('NO')
	else:
		print('YES')


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
q = inp()
for i in range(q):
	(x, y) = invr()
	s = int(x - y)
	if s == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for tt in range(t):
	(x, y) = map(int, input().split())
	xx = x - y
	if xx == 1:
		print('NO')
	else:
		print('YES')


from math import *
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')
t = ii()
for i in range(t):
	(a, b) = mi()
	if abs(a - b) > 1:
		print('YES')
	else:
		print('NO')


try:
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		c = abs(a - b)
		if c > 1:
			print('YES')
		else:
			print('NO')
except:
	pass


import sys
import math as mt
input = sys.stdin.buffer.readline
t = int(input())
for __ in range(t):
	(x, y) = map(int, input().split())
	if x - y == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split(' '))
	if a - b <= 1:
		print('NO')
	else:
		print('YES')


def main():
	for _ in range(int(input())):
		(n, m) = map(int, input().split())
		print(('NO', 'YES')[n - m > 1])
main()


def main():
	nTests = int(input())
	outputs = []
	(x, y) = (0, 0)
	for i in range(nTests):
		xandy = [int(k) for k in input().split()]
		x = xandy[0]
		y = xandy[1]
		if x - y > 1:
			outputs.append('YES')
		else:
			outputs.append('NO')
	for i in range(nTests):
		print(outputs[i])
main()


def main():
	(T, *XY) = map(int, open(0).read().split())
	ans = []
	for (x, y) in zip(*[iter(XY)] * 2):
		if x - y != 1:
			ans.append('YES')
		else:
			ans.append('NO')
	print('\n'.join(map(str, ans)))
main()


def primeSubs(num1, num2):
	dif = abs(num1 - num2)
	if dif == 1:
		return 'NO'
	else:
		return 'YES'
num = int(input())
for i in range(num):
	(num1, num2) = map(int, input().split())
	print(primeSubs(num1, num2))


t = int(input())
for _ in range(t):
	(a, b) = [int(i) for i in input().split()]
	if a - 2 >= b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	t = list(map(int, input().split(' ')))
	print('YES' if t[0] - 1 != t[1] else 'NO')


t = int(input())
for i in range(t):
	(x, y) = [int(j) for j in input().split()]
	n = x - y
	if n != 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for j in range(t):
	ele = list(map(int, input().rstrip().split()))
	x = ele[0]
	y = ele[1]
	if x == y + 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	s = input().split()
	x = int(s[0])
	y = int(s[1])
	if x - y == 1:
		print('NO')
	else:
		print('YES')


def difference(x, y):
	if x - y < 2:
		answer = 'NO'
	else:
		answer = 'YES'
	return answer

def prime_subtraction(t):
	answers = []
	for i in range(t):
		line_t = list(map(int, input().split()))
		solve = difference(line_t[0], line_t[1])
		answers.append(solve)
	for i in answers:
		print(i)
t = int(input())
prime_subtraction(t)


for i in range(int(input())):
	(x, y) = map(int, input().split())
	dif = x - y
	if dif != 1:
		print('YES')
	else:
		print('NO')


for j in range(int(input())):
	(s, o) = list(map(int, input().split()))
	if s - o == 0 or s - o == 1:
		print('NO')
	else:
		print('YES')


for nt in range(int(input())):
	(x, y) = map(int, input().split())
	if y == x - 1:
		print('NO')
		continue
	print('YES')


t = int(input())
for i in range(t):
	(x, y) = list(map(int, input().split(' ')))
	answer = 'YES'
	if x - y <= 1:
		answer = 'NO'
	print(answer)


num = int(input())
while num:
	arr = list(map(int, input().split()))
	if arr[0] - arr[1] <= 1:
		print('NO')
	else:
		print('YES')
	num -= 1


for i in range(int(input())):
	X = list(map(int, input().split()))
	print('YES' if X[0] - X[1] > 1 else 'NO')


for _ in range(int(input())):
	s = input().split()
	(x, y) = (int(s[0]), int(s[1]))
	print('NO' if x - y == 1 else 'YES')


tc = int(input())
for ii in range(tc):
	(n, m) = map(int, input().split())
	if n - m > 1:
		print('YES')
	else:
		print('NO')


def mi():
	return map(int, input().split())

def li():
	return list(mi())

def ii():
	return int(input())

def fun(n):
	for i in range(2, n ** (1 // 2) + 1):
		if n % i == 0:
			return 0
	return 1
t = ii()
while t:
	t -= 1
	(n, m) = mi()
	p = n - m
	f = 0
	for i in range(p, 1, -1):
		if fun(i):
			if p % i == 0:
				f = 1
				print('YES')
				break
	if f == 0:
		print('NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print(['YES', 'NO'][x - y < 2])


q = int(input())
while q:
	(x, y) = map(int, input().split())
	if x - y > 1:
		print('YES')
	else:
		print('NO')
	q -= 1


def check(num):
	if num == 1:
		return False
	for ind in range(2, num ** 2 + 1):
		if not num % ind:
			return False
	return True
n = int(input())
for test in range(n):
	(x, y) = list(map(int, input().split()))
	delim = x - y
	if delim == 1:
		print('NO')
	else:
		print('YES')


import sys

def rint():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().rstrip('\n')

def oint():
	return int(input())
t = oint()
for _ in range(t):
	(x, y) = rint()
	if x - y == 1:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	print('NO' if n - m == 1 else 'YES')


import sys
t = int(sys.stdin.readline().strip())
for _ in range(t):
	(x, y) = [int(_) for _ in sys.stdin.readline().split()]
	if x - y > 1:
		sys.stdout.write('YES\n')
	else:
		sys.stdout.write('NO\n')


t = int(input())
while t > 0:
	t = t - 1
	(n, m) = map(int, input().split())
	if n - m < 2:
		print('NO')
	else:
		print('YES')


from math import sqrt

def is_prime(n):
	if n < 2:
		return False
	if n == 2:
		return True
	limit = sqrt(n)
	i = 2
	while i <= limit:
		if n % i == 0:
			return False
		i += 1
	return True
t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	q = x - y
	if q != 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for z in range(t):
	(x, y) = map(int, input().split())
	if x - y == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
for _ in range(n):
	(x, y) = map(int, input().split())
	t = x - y
	if t == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().strip().split()))
	if a - b >= 2:
		print('YES')
	else:
		print('NO')


import math
number_of_queries = int(input())
x = []
y = []
difference = []
for i in range(0, number_of_queries):
	a = input()
	x.append(int(a.split(' ')[0]))
	y.append(int(a.split(' ')[1]))
	difference.append(x[i] - y[i])
for i in range(0, number_of_queries):
	if difference[i] == 1:
		print('NO')
	else:
		print('YES')


def isprime(x):
	if x == 1:
		return False
	elif x == 2 or x == 3 or x == 5:
		return True
	elif x % 2 == 0 or x % 3 == 0:
		return False
	else:
		i = 5
		while i ** 2 < x:
			if x % i == 0 or x % (i + 2) == 0:
				return False
			i += 6
	return True
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	rem = x - y
	if rem > 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	print(a - b > 1 and 'YES' or 'NO')


tcs = int(input())
for ntc in range(tcs):
	(x, y) = list(map(int, input().split()))
	diff = x - y
	if x == y:
		print('YES')
	elif diff == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
while t > 0:
	(x, y) = input().split(' ')
	x = int(x)
	y = int(y)
	c = 0
	p = x - y
	if p == 1:
		print('NO')
	else:
		print('YES')
	t -= 1


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
from collections import deque
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		(x, y) = map(int, input().split())
		if x > y + 1:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
for j in range(1, t + 1):
	x = list(map(int, input().split()))
	c = x[0] - x[1]
	if c == 1:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(x, y) = list(map(int, input().split()))
	if x - y >= 2:
		print('YES')
	else:
		print('NO')


t = int(input())
for queries in range(t):
	(x, y) = map(int, input().split())
	num = x - y
	if num == 1 or num == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	if x % 2 != y % 2:
		x -= 3
	if x < y:
		print('NO')
	else:
		print('YES')


T = int(input())
for _t in range(T):
	(x, y) = list(map(int, input().strip().split()))
	print('YES' if x - y != 1 else 'NO')


def is_avval(x):
	if x == 1:
		return False
	m = 0
	for j in range(1, (x + 1) // 2 + 1):
		if x % j == 0:
			m += 1
	if m == 1:
		return True
	else:
		return False
t = int(input())
javab = []
for s in range(t):
	javab.append(0)
for i in range(t):
	(x, y) = [int(x) for x in input().split()]
	tafazol = x - y
	for k in range(1, tafazol + 1):
		if is_avval(k) == True and tafazol % is_avval(k) == 0:
			javab[i] = 1
			break
for i in range(t):
	if javab[i] == 1:
		print('YES')
	else:
		print('NO')


ts = int(input())
for t in range(ts):
	(a, b) = list(map(int, input().split()))
	if a - b > 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if abs(a - b) == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for x in range(t):
	(a, b) = map(int, input().split())
	print(['NO', 'YES'][a - b >= 2])


def solve():
	(x, y) = map(int, input().split())
	if x - y > 1:
		print('YES')
	else:
		print('NO')
q = int(input())
for _ in range(0, q):
	solve()


query = int(input())
for q in range(query):
	(a, b) = map(int, input().split())
	if a - b != 1:
		print('YES')
	else:
		print('NO')


def isDivisible(x, y):
	return x > y + 1
count = int(input())
for _ in range(count):
	(x, y) = [int(x) for x in input().split()]
	if isDivisible(x, y):
		print('YES')
	else:
		print('NO')


import sys
import math
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	d = x - y
	if d >= 2:
		print('YES')
	else:
		print('NO')


import itertools
t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	if abs(x - y) == 1:
		print('NO')
	else:
		print('YES')


T = int(input())
for a in range(T):
	(x, y) = map(int, input().split())
	if x - y != 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	d = x - y
	if d != 1:
		print('YES')
	else:
		print('NO')


import os, sys
from io import IOBase, BytesIO

def main():
	for i in range(int(input())):
		(a, b) = input().split()
		a = int(a)
		b = int(b)
		if abs(a - b) > 1:
			print('YES')
		else:
			print('NO')
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		py2 = round(0.5)
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2 == 1:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip()
main()


from collections import defaultdict as dd
from collections import Counter as ccd
from itertools import permutations as pp
from itertools import combinations as cc
from random import randint as rd
from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq as hq
from math import gcd
mod = pow(10, 9) + 7

def inp(flag=0):
	if flag == 0:
		return list(map(int, input().strip().split(' ')))
	else:
		return int(input())
t = inp(1)
while t:
	t -= 1
	(n1, n2) = inp()
	if n1 - n2 == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
for _ in range(n):
	(x, y) = [int(x) for x in input().split()]
	sub = x - y
	if sub > 1:
		print('YES')
	else:
		print('NO')


def check_prime_subtraction(input_list):
	deff = input_list[0] - input_list[1]
	if deff > 1:
		return 'YES'
	else:
		return 'NO'
inputs = []
inputs_num = int(input())
while inputs_num > 0:
	input_data = input().split(' ')
	input_list = []
	for i in input_data:
		input_list.append(int(i))
	inputs.append(input_list)
	inputs_num -= 1
for i in inputs:
	print(check_prime_subtraction(i))


queries = int(input())
numlist = []
difference = 0
for x in range(queries):
	nums = input()
	nums = nums.split(' ')
	numlist.append([int(nums[0]), int(nums[1])])
for x in numlist:
	difference = x[0] - x[1]
	if difference == 1:
		print('NO')
	else:
		print('YES')


T = int(input())
while T > 0:
	T -= 1
	(a, b) = list(map(int, input().split()))
	diff = a - b
	if diff < 0 or diff == 1:
		print('NO')
	else:
		print('YES')


test_c = int(input())
ans = []
for i in range(test_c):
	(x, y) = tuple(map(int, input().split()))
	q = x - y
	if q > 1:
		ans.append('YES')
	else:
		ans.append('NO')
for a in ans:
	print(a)


t = int(input())
for i in range(t):
	(x, y) = [int(d) for d in input().split()]
	if x - y > 1 or y - x > 1:
		print('YES')
	else:
		print('NO')


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
test_count = inp()
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	(x, y) = invr()
	d = x - y
	print('YES' if d > 1 else 'NO')


n = int(input())
for i in range(n):
	a = list(map(int, input().split()))
	if abs(a[0] - a[1]) == 1:
		print('NO')
	else:
		print('YES')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = I()
	rr = []
	for _ in range(t):
		(x, y) = LI()
		rr.append(IF(x - y == 1, 'NO', 'YES'))
	return JA(rr, '\n')
print(main())


def calc(x: int, y: int):
	if x - y == 1:
		return 'NO'
	else:
		return 'YES'

def main():
	for _ in range(int(input())):
		(x, y) = map(int, input().split())
		print(calc(x, y))
main()


import sys
readline = sys.stdin.readline
read = sys.stdin.read
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
	(x, y) = nm()
	print('YES' if x - 1 > y else 'NO')
	return
T = ni()
for _ in range(T):
	solve()


t = int(input())
ans = [True] * t
for i in range(t):
	(x, y) = map(int, input().split())
	x -= y
	if x == 1:
		ans[i] = False
		continue
for i in ans:
	print('YES' if i else 'NO')


from sys import stdin

def _gcd(a, b):
	if a == 0:
		return b
	return _gcd(b % a, a)

def _sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	return prime
alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
mod = 10 ** 9 + 7
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x - y < 2:
		print('NO')
	else:
		print('YES')


import math
t = int(input())
for i in range(t):
	(n, m) = list(map(int, input().split()))
	if n - m != 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(x, y) = list(map(int, input().split()))
	p = x - y
	if p == 1:
		print('NO')
	else:
		print('YES')


def solve():
	(x, y) = map(int, input().split())
	ans = 'YES'
	if x - y == 1:
		ans = 'NO'
	return ans

def main():
	T = int(input())
	for _ in range(T):
		print(solve())
main()


q = int(input())
for i in range(q):
	arr = list(map(int, input().split()))
	if arr[0] - arr[1] > 1:
		print('YES')
	else:
		print('NO')


def f(i):
	(x, y) = i
	if abs(x - y) == 1:
		return 'NO'
	else:
		return 'YES'
l = []
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	l.append([x, y])
ans = [f(i) for i in l]
for i in ans:
	print(i)


t = int(input())
for i in range(t):
	(n1, n2) = map(int, input().split())
	if n1 - n2 >= 2:
		print('YES')
	else:
		print('NO')


from collections import defaultdict
n = int(input())
for _ in range(n):
	(x, y) = map(int, input().split())
	if x - y != 1:
		print('YES')
	else:
		print('NO')


import bisect
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if a - b < 2:
		print('NO')
	else:
		print('YES')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	if x > y + 1:
		print('YES')
	else:
		print('NO')


t = input()
for i in range(int(t)):
	str = input()
	list0 = str.split(' ')
	if int(list0[0]) - int(list0[1]) == 1:
		print('NO')
	else:
		print('YES')


import math
for _ in range(int(input())):
	(x, y) = [int(j) for j in input().split()]
	if x - y == 1:
		print('NO')
	else:
		print('YES')


num_queries = int(input())
for _ in range(num_queries):
	numbers = list(map(int, input().split(' ')))
	if numbers[0] - numbers[1] == 1:
		print('NO')
	else:
		print('YES')


from sys import stdin, stdout
n = int(stdin.readline().strip())
for i in range(n):
	(n, m) = map(int, stdin.readline().strip().split())
	if n - m == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	if abs(x - y) > 1:
		print('YES')
	else:
		print('NO')


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(q,) = I()
while q:
	q -= 1
	(x, y) = I()
	if x - y >= 2:
		print('YES')
	else:
		print('NO')


t = int(input())
for z in range(t):
	(a, b) = map(int, input().split(' '))
	if a - b != 1:
		print('YES')
	else:
		print('NO')


z = int(input())
for i in range(z):
	(a, b) = [int(i) for i in input().split()]
	if a - b == 0:
		print('NO')
	elif a - b == 1:
		print('NO')
	else:
		print('YES')


def get_ints():
	return list(map(int, input().split()))

def isPrime(n):
	for i in range(2, n):
		if n % i == 0:
			return False
	return True
for _ in range(int(input())):
	(x, y) = get_ints()
	if x == y + 1:
		print('NO')
		continue
	print('YES')


q = int(input())
out = []
for i in range(q):
	(x, y) = map(int, input().split())
	if x - y == 1:
		out.append('NO')
	else:
		out.append('YES')
print('\n'.join(out))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if n - k == 1:
		print('NO')
	else:
		print('YES')


def primesub(x, y):
	if x - y == 1:
		return 'NO'
	else:
		return 'YES'
t = int(input())
for i in range(t):
	c = input().split()
	x = int(c[0])
	y = int(c[1])
	print(primesub(x, y))


t = int(input())
while t:
	t -= 1
	(x, y) = [int(x) for x in input().split()]
	print('NO') if x - y == 1 else print('YES')


result = []
for i in range(int(input())):
	string = input()
	(x, y) = string.split(' ')
	x = int(x)
	y = int(y)
	sub = x - y
	if sub > 1:
		result.append('YES')
	else:
		result.append('NO')
for i in result:
	print(i)


import math

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def msi():
	return input().split()

def li():
	return list(mi())

def isplli(n):
	for i in range(2, n ** (1 // 2) + 1):
		if n % i == 0:
			return 0
	return 1
t = ii()
while t:
	f = 0
	t -= 1
	(n, m) = mi()
	p = n - m
	c = 0
	for i in range(p, 1, -1):
		if isplli(i):
			if p % i == 0:
				print('YES')
				f = 1
				break
	if f == 0:
		print('NO')


t = int(input())
while t:
	(x, y) = map(int, input().split(' '))
	delta = x - y
	if delta >= 2:
		print('YES')
	else:
		print('NO')
	t -= 1


n = int(input())
for i in range(1, n + 1):
	f = input().split()
	print('YES' if int(f[0]) - int(f[1]) > 1 else 'NO')


for _ in range(int(input())):
	(x, y) = [int(s) for s in input().split()]
	if x - y >= 2:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(q, w) = map(int, input().split())
	if q - w == 1:
		print('NO')
	else:
		print('YES')


import sys
from collections import defaultdict as dd
from itertools import permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from heapq import heappush as hpush
from heapq import heappop as hpop
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
for _ in range(ri(1)):
	(x, y) = ri()
	if x <= y + 1:
		print('NO')
	else:
		print('YES')


def compute(n, m):
	if abs(n - m) == 1:
		return 'NO'
	return 'YES'
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	print(compute(n, m))


de = [2, 3, 5, 7, 11]
for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = a - b
	if c % 2 == 1 and c > 1:
		c -= 3
	print('YES' if c % 2 == 0 else 'NO')


def sub(a, b):
	a = int(a, 10)
	b = int(b, 10)
	return a - b
t = int(input())
for i in range(t):
	x = input()
	y = x.split(' ')
	if sub(y[0], y[1]) == 1:
		print('NO')
	else:
		print('YES')


from math import *
for zz in range(int(input())):
	(x, y) = map(int, input().split())
	d = x - y
	if d >= 3 and d % 2 == 1 or (d >= 2 and d % 2 == 0):
		print('YES')
	else:
		print('NO')


test = int(input())
for j in range(test):
	(x, y) = map(int, input().split())
	diff = x - y
	if diff == 1:
		print('NO')
	else:
		print('YES')


q = int(input())
for query in range(q):
	(m, n) = list(map(int, input().split()))
	if m - n <= 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for p in range(t):
	(x, y) = map(int, input().split())
	dif = x - y
	if dif == 1:
		print('NO')
	else:
		print('YES')


Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
for (x, y) in Query:
	a = x - y
	if a > 1:
		print('YES')
	else:
		print('NO')


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i += 6
	return True
n = int(input())
while n > 0:
	(x, y) = input().split()
	(x, y) = (int(x), int(y))
	h = x - y
	if h < 2:
		print('NO')
	elif (h % i == 0 for i in [2, 3, 5, 7, 11, 13, 17, 19, 23]):
		print('YES')
	else:
		l = [i for i in range(27, h // 2) if isPrime(i) == True]
		if (len(l) != 0 and h % i == 0 for i in l):
			print('YES')
		else:
			print('NO')
	n = n - 1


t = int(input())
while t > 0:
	a = list(map(int, input().split()))
	if a[0] == a[1]:
		print('YES')
	elif a[0] - a[1] > 1:
		print('YES')
	else:
		print('NO')
	t -= 1


tc = int(input())
while tc != 0:
	tc -= 1
	(a, b) = map(int, input().split())
	if a - b > 1:
		print('YES')
	else:
		print('NO')


from collections import defaultdict as dc
import sys
import math
input = sys.stdin.readline
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if abs(x - y) == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
while t > 0:
	w = input().split()
	a = int(w[0])
	b = int(w[1])
	if a - b > 1:
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	dif = n - x
	if dif == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	val = n - m
	if val == 1:
		print('NO')
	elif val == 0:
		print('YES')
	else:
		print('YES')


from sys import stdout, stdin, setrecursionlimit
from io import BytesIO, IOBase
from collections import *
from itertools import *
from random import *
from bisect import *
from string import *
from queue import *
from heapq import *
from math import *
from re import *
from os import *

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))

def input():
	return stdin.readline().strip()

def fast():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in fast().split()]
(z, zz) = (fast, lambda : map(int, z().split()))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer, end='\n'):
	stdout.write(str(answer) + end)
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
num = int(z())
prime = [1] * 10001
for i in range(2, 10001):
	for j in range(i * i, 10001, i):
		prime[j] = 0
for _ in range(num):
	(x, y) = zzz()
	rem = x - y
	print('YES' if rem != 1 else 'NO')


def is_get_y(x, y):
	diff = x - y
	if diff == 1:
		return 'NO'
	else:
		return 'YES'
t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	print(is_get_y(x, y))


t = int(input())
for case in range(t):
	(x, y) = list(map(int, input().split()))
	if x - y == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
main = []
rpta = []
for i in range(t):
	main = list(map(int, input().split()))
	if main[0] - main[1] == 1:
		rpta.append('NO')
	else:
		rpta.append('YES')
for maiden in rpta:
	print(maiden)


q = int(input())
for _ in range(q):
	(x, y) = list(map(int, input().split()))
	if abs(x - y) == 1:
		print('NO')
	else:
		print('YES')


u = int(input())
d = []
for i in range(u):
	(x, y) = map(int, input().split())
	if x - y == 1:
		d.append('NO')
	else:
		d.append('YES')
for i in range(u):
	print(d[i])


num = int(input())
for i in range(num):
	(x, y) = input().split(' ')
	difference = int(x) - int(y)
	if difference != int(1) and difference > 0:
		print('YES')
	else:
		print('NO')


def distance(a, b):
	if a - b > 1:
		return 'YES'
	else:
		return 'NO'
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(distance(a, b))


t = int(input())
for i in range(0, t):
	a = list(map(int, input().split()))
	s = a[0] - a[1]
	if s != 1:
		print('YES')
	else:
		print('NO')


from sys import stdin
for _ in range(int(stdin.readline())):
	(x, y) = list(map(int, stdin.readline().split()))
	print('YES' if x - y > 1 else 'NO')


t = int(input())
while t:
	(a, b) = map(int, input().rstrip().split(' '))
	if a - b > 1:
		print('YES')
	else:
		print('NO')
	t = t - 1


N = int(input())

def solve(x, y):
	if x > y + 1:
		print('YES')
	else:
		print('NO')
for i in range(N):
	(x, y) = map(int, input().split())
	solve(x, y)


test = input()
for i in range(int(test)):
	nums = input().split()
	a = int(nums[0])
	b = int(nums[1])
	if a - b > 1:
		print('YES')
	else:
		print('NO')


t = int(input())

def is_prime(a):
	return all((a % i for i in xrange(2, a)))
for i in range(t):
	(x, y) = list(map(int, input().split()))
	a = x - y
	if a > 1:
		print('YES')
	else:
		print('NO')


from sys import stdin
import math
t = int(stdin.readline())
tests = []
results = []
for _ in range(t):
	tests.append(tuple(map(int, stdin.readline().rstrip().split())))
for test in tests:
	val = test[0] - test[1]
	answer = 'YES' if val not in (0, 1) else 'NO'
	results.append(answer)
print('\n'.join(results))


def f(l):
	(x, y) = l
	return x - y > 1
t = int(input())
for _ in range(t):
	l = list(map(int, input().split()))
	print('YES' if f(l) else 'NO')


t = int(input())
for x in range(t):
	(x, y) = input().split()
	(x, y) = (int(x), int(y))
	if abs(x - y) < 2:
		print('NO')
	else:
		print('YES')


n = int(input())
a = []
for i in range(n):
	(x, y) = [int(x) for x in input().split()]
	a.append(True if x - y > 1 else False)
for i in range(n):
	if a[i]:
		print('YES')
	else:
		print('NO')


def sr(ch):
	ch1 = ch + ' '
	l = []
	p = ''
	for i in ch1:
		if i != ' ':
			p = p + i
		else:
			l.append(int(p))
			p = ''
	return l
t = int(input())
l = []
for i in range(t):
	ch = str(input())
	l.append(sr(ch))
for i in l:
	if i[0] - i[1] in [1, 0]:
		print('NO')
	else:
		print('YES')


am = int(input())
for i in range(am):
	strIn = input().split()
	if int(strIn[0]) - int(strIn[1]) >= 2:
		print('YES')
	else:
		print('NO')


t = int(input())
for cases in range(t):
	s = input()
	L = [int(item) for item in s.split(' ')]
	x = L[0]
	y = L[1]
	if x - y > 1:
		print('YES')
	else:
		print('NO')


import sys
import math
from collections import defaultdict
from itertools import combinations
from itertools import permutations
input = lambda : sys.stdin.readline().rstrip()
read = lambda : map(int, input().split())

def write(*args, sep='\n'):
	for i in args:
		sys.stdout.write('{}'.format(i) + sep)
INF = float('inf')
MOD = int(1000000000.0 + 7)
for q in range(int(input())):
	(x, y) = read()
	if x - y >= 2:
		print('YES')
	else:
		print('NO')


import sys
t = int(sys.stdin.readline())
for i in range(t):
	(a, b) = map(int, sys.stdin.readline().split())
	if a == b + 1:
		print('NO')
	else:
		print('YES')


import sys
import itertools
import math
import collections
from collections import Counter

def pow(x, y, mod):
	r = 1
	x = x % mod
	while y > 0:
		if y & 1:
			r = r * x % mod
		y = y >> 1
		x = x * x % mod
	return r

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)
q = ii()
for _ in range(q):
	(a, b) = mi()
	print('YES') if a - b > 1 else print('NO')


test_cases = int(input())
for cases in range(test_cases):
	(x, y) = input().split(' ')
	(x, y) = (int(x), int(y))
	if x - y > 1:
		print('YES')
	else:
		print('NO')


for step in range(int(input())):
	(x, y) = map(int, input().split())
	if x - y == 1:
		print('NO')
	else:
		print('YES')


t = int(input(''))
res = []
for i in range(0, t):
	(x, y) = map(int, input().split())
	if x - y >= 2:
		res.append('YES')
	else:
		res.append('NO')
for r in res:
	print(r)


t = int(input())
for i in range(t):
	delta = [int(x) for x in input().split()]
	if delta[0] - delta[1] == 1:
		print('NO')
	else:
		print('YES')


q = int(input())
for j in range(0, q):
	a = list(map(int, input().split()))
	if a[0] - a[1] == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
for _ in range(n):
	(a, b) = list(map(int, input().split()))
	if a - b >= 2:
		print('YES')
	else:
		print('NO')


t = int(input())

def f(x, y):
	a = x - y
	if a == 1:
		print('NO')
	else:
		print('YES')
i = 0
while i in range(t):
	(x, y) = map(int, input().split())
	f(x, y)
	i += 1


def primeSubstraction(t):
	(x, y) = map(int, input().split())
	if x - y > 1:
		return 'YES'
	return 'NO'

def main():
	t = int(input())
	for _ in range(t):
		print(primeSubstraction(t))
main()


a = int(input())
for i in range(a):
	b = input().split()
	if abs(int(b[0]) - int(b[1])) <= 1:
		print('NO')
	else:
		print('YES')


case = int(input())
cikti = []
for i in range(case):
	deneme = input().split()
	sayi = int(deneme[0]) - int(deneme[1])
	if sayi == 1:
		cikti.append('NO')
	else:
		cikti.append('YES')
for j in cikti:
	print(j)


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	if (x - y) % 2 == 0:
		print('YES')
		continue
	elif (x - y) % 3 == 0:
		print('YES')
		continue
	elif (x - y) % 5 == 0:
		print('YES')
		continue
	elif (x - y) % 7 == 0:
		print('YES')
		continue
	elif (x - y) % 11 == 0:
		print('YES')
		continue
	elif x - y == 1:
		print('NO')
		continue
	z = x - y
	while z >= 0:
		if z % 2 == 0:
			print('YES')
			break
		z -= 3
	if z < 0:
		print('NO')


u = int(input())
for i in range(u):
	(a, b) = map(int, input().split())
	c = a - b
	if c == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
while t > 0:
	(a, b) = [int(i) for i in input().split()]
	if a - b > 1:
		print('YES')
	else:
		print('NO')
	t -= 1


for _ in range(int(input())):
	a = input().split()
	print('YES' if int(a[0]) - int(a[1]) > 1 else 'NO')


t = int(input())
for tc in range(t):
	(x, y) = map(int, input().split(' '))
	d = x - y
	if d % 2 == 0 or d >= 3:
		print('YES')
	else:
		print('NO')


import sys, math, queue, collections
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x - y <= 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	a = str(input()).split()
	x = int(a[0])
	y = int(a[1])
	k = x - y
	if k != 1:
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	[A, B] = list(map(int, input().split()))
	print('NO' if A - B == 1 else 'YES')


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	d = x - y
	if d < 0:
		print('NO')
	elif d == 0:
		print('YES')
	elif d == 1:
		print('NO')
	elif d > 1:
		print('YES')


n = int(input())
(xx, yy) = (list(), list())
for _ in range(n):
	(x, y) = [int(i) for i in input().split()]
	xx.append(x)
	yy.append(y)
for (x, y) in zip(xx, yy):
	if y + 1 == x:
		print('NO')
	else:
		print('YES')


def mp():
	return map(int, input().split())
t = int(input())
for tt in range(t):
	(x, y) = mp()
	if x - y == 1:
		print('NO')
	else:
		print('YES')


casos = int(input())
while casos > 0:
	(numero1, numero2) = input().split()
	if int(numero1) - int(numero2) > 1:
		print('YES')
	else:
		print('NO')
	casos = casos - 1


t = int(input())
outputs = []
for i in range(t):
	ip = input().split()
	x = int(ip[0])
	y = int(ip[1])
	if x - y > 1:
		outputs.append('YES')
	else:
		outputs.append('NO')
for i in outputs:
	print(i)


q = int(input())
for i in range(q):
	(x, y) = [int(x) for x in input().split()]
	if x - y == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
primes = [2, 3, 5, 7, 11]
for _ in range(t):
	(x, y) = map(int, input().split())
	d = x - y
	for i in primes:
		if d % i == 0:
			print('YES')
			break
	else:
		i = 0
		while d > primes[-1]:
			i += 1
			k = primes[-1] + i
			sqrt = int(k ** 0.5) + 1
			for div in range(3, sqrt, 2):
				if k % div == 0:
					continue
			primes.append(k)
			print('YES')
			break
		else:
			print('NO')


from math import ceil, log, floor, sqrt
import math
k = 1

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def is_prime(n):
	m = 2
	while m * m <= n:
		if n % m == 0:
			return False
		m += 1
	return True

def find_sum(n, a):
	a.insert(0, 0)
	for i in range(1, n + 1):
		prev = a[i] & a[i - 1]
		cur = a[i] | a[i - 1]
		a[i - 1] = prev
		a[i] = cur
	return sum((m * m for m in a))

def prin_abc(x, y, z):
	l = [x, y, z]
	l.sort()
	if l[1] < l[2]:
		print('NO')
		return
	a = b = l[0]
	c = l[2]
	print('YES')
	print(a, b, c)

def get_scores(n, vals):
	l = 0
	r = n - 1
	turn = 0
	sereja = 0
	dima = 0
	while l <= r:
		if vals[l] > vals[r]:
			cur = vals[l]
			l += 1
		else:
			cur = vals[r]
			r -= 1
		if turn == 0:
			sereja += cur
		else:
			dima += cur
		turn = not turn
	print(sereja, dima)

def count_lamps(n, m):
	return (n * m + 1) // 2

def find_holidays(n):
	cnt = 2 * (n // 7)
	rem = n % 7
	mx = mn = cnt
	if rem == 1:
		mx += 1
	elif rem > 1:
		mx += 2
	if rem == 6:
		mn += 1
	print(mn, mx)

def count_eggs(n, s, t):
	return max(1, max(n - s + 1, n - t + 1))

def only_primes(x, y):
	return x > y + 1
t = 1
t = int(input())
while t:
	t = t - 1
	(k, g) = (0, 0)
	points = []
	(x, y) = map(int, input().split())
	if only_primes(x, y):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x - y == 1 or x - y == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(q, w) = map(int, input().split())
	if abs(w - q) == 1:
		print('NO')
	else:
		print('YES')


import math as mt
import sys
from collections import *
inf = float('inf')

def ii():
	return int(input())

def mii():
	return map(int, input().split())

def lii():
	return list(map(int, input().split()))

def gmat(n, m):
	return [[0] * m for _ in range(n)]

def imat(n):
	return [list(mii()) for _ in range(n)]
try:
	sys.stdin = open('a.in', 'r')
	input = sys.stdin.readline
except:
	pass
for _ in range(ii()):
	(a, b) = mii()
	if a - b > 1:
		print('YES')
	else:
		print('NO')


a = int(input())
for i in range(a):
	(b, c) = input().split()
	b = int(b)
	c = int(c)
	if b - c != 0 and b - c != -1 and (b - c != 1):
		print('YES')
	else:
		print('NO')


def main():
	t = int(input())
	for i in range(t):
		(x, y) = (int(i) for i in input().split())
		z = x - y
		if z > 1:
			print('YES')
		else:
			print('NO')
main()


f = int(input())
for q in range(f):
	(x, y) = map(int, input().split())
	if x - y == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	(x, y) = [int(w) for w in input().split()]
	print('YES' if x > y + 1 else 'NO')


import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

def solve():
	(x, y) = map(int, input().split())
	if x - y == 1:
		print('NO')
	else:
		print('YES')
N = int(input())
for _ in range(N):
	solve()


a = int(input())
for i in range(a):
	(n, k) = map(int, input().split())
	s = n - k
	if s == 0 or s == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	arr = [int(x) for x in input().split()]
	a = arr[0]
	b = arr[1]
	if a - b != 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for k in range(t):
	flag = True
	(a, b) = map(int, input().split())
	diff = a - b
	if diff == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	a = input()
	b = a.split()
	c = [int(d) for d in b]
	x = c[0]
	y = c[1]
	dif = x - y
	if dif % 2 == 0:
		print('YES')
	elif dif % 2 != 0 and dif != 1:
		print('YES')
	else:
		print('NO')


import sys

def rl():
	return sys.stdin.readline().strip()

def rn():
	return list(map(int, sys.stdin.readline().strip().split()))

def rln(n):
	l = [None] * n
	for i in range(n):
		l[i] = int(rl())
	return l
t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	print('YES' if x - y != 1 else 'NO')


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
t = read_int()
for test in range(t):
	(x, y) = read_int_array()
	print('YES' if x - y > 1 else 'NO')


def s(x, y):
	diff = x - y
	if diff == 1:
		return 'NO'
	else:
		return 'YES'
queries = int(input())
for __ in range(queries):
	query = input().split()
	x = int(query[0])
	y = int(query[1])
	print(s(x, y))


T = int(input())

def ans(x, y):
	d = x - y
	if d == 1:
		return 'NO'
	return 'YES'
for _ in range(T):
	(x, y) = input().split(' ')
	x = int(x)
	y = int(y)
	print(ans(x, y))


n = int(input())
while n:
	a = input().split()
	if int(a[0]) - int(a[1]) == 1:
		print('NO')
	else:
		print('YES')
	n -= 1


I = lambda : map(int, input().split())
for _ in range(int(input())):
	(x, y) = I()
	if not x - y == 1:
		print('YES')
	else:
		print('NO')


t = int(input())

def solve():
	(x, y) = [int(l) for l in input().split()]
	largest = x - y
	if largest == 1:
		return 'NO'
	else:
		return 'YES'
for _ in range(t):
	print(solve())


import math
sqrt = math.sqrt

def isPrime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
t = int(input())
for i in range(t):
	x = list(map(int, input().split()))
	if x[0] - x[1] <= 10 ** 4:
		for n in range(2, 10 ** 4 + 1):
			if x[0] - x[1] >= n and isPrime((x[0] - x[1]) / n):
				print('YES')
				break
			elif x[0] - x[1] >= n and (not isPrime((x[0] - x[1]) / n)):
				continue
			else:
				print('NO')
				break
	elif x[0] - x[1] <= 10 ** 9:
		for n in range(10 ** 4, 10 ** 9 + 1):
			if x[0] - x[1] >= n and isPrime((x[0] - x[1]) / n):
				print('YES')
				break
			elif x[0] - x[1] >= n and (not isPrime((x[0] - x[1]) / n)):
				continue
			else:
				print('NO')
				break
	elif x[0] - x[1] <= 10 ** 13:
		for n in range(10 ** 9, 10 ** 13 + 1):
			if x[0] - x[1] >= n and isPrime((x[0] - x[1]) / n):
				print('YES')
				break
			elif x[0] - x[1] >= n and (not isPrime((x[0] - x[1]) / n)):
				continue
			else:
				print('NO')
				break
	else:
		for n in range(10 ** 13, 10 ** 18 + 1):
			if x[0] - x[1] >= n and isPrime((x[0] - x[1]) / n):
				print('YES')
				break
			elif x[0] - x[1] >= n and (not isPrime((x[0] - x[1]) / n)):
				continue
			else:
				print('NO')
				break


t = int(input())
for i in range(t):
	s = input()
	s = s.split()
	for e in s:
		s[s.index(e)] = int(e)
	if s[0] - s[1] < 2:
		print('NO')
	elif (s[0] - s[1]) % 2 == 0:
		print('YES')
	elif s[0] - s[1] - 3 >= 0:
		print('YES')
	else:
		print('NO')


for w in range(int(input())):
	(x, y) = (int(i) for i in input().split())
	k = x - y
	if k > 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	if a - b == 1:
		print('NO')
	else:
		print('YES')


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if n - m == 1:
		print('NO')
	else:
		print('YES')


N = int(input())
for n in range(N):
	(X, Y) = map(int, input().split())
	if X - Y == 1:
		print('NO')
	else:
		print('YES')


from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 6)
input = stdin.readline
t = int(input().rstrip())
for _ in range(t):
	(x, y) = map(int, input().split())
	print('YES' if x - y > 1 else 'NO')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
testcases = int(input())
for j in range(testcases):
	(x, y) = map(int, input().split())
	if abs(x - y) == 1:
		print('NO')
	else:
		print('YES')


cases = int(input())
for case in range(cases):
	result = 'YES'
	values = input().split()
	(number_1, number_2) = (int(values[0]), int(values[1]))
	difference = number_1 - number_2
	if difference == 1:
		result = 'NO'
	print(result)


from sys import *
from heapq import *
for q in range(int(input())):
	(x, y) = map(int, input().split())
	if x > y + 1:
		print('YES')
	else:
		print('NO')


n = int(input())
r = []
for i in ' ' * n:
	(a, b) = map(int, input().split())
	r += ['YNEOS'[a - b < 2::2]]
for i in r:
	print(i)


import sys
import math
import bisect

def main():
	for _ in range(int(input())):
		(x, y) = map(int, input().split())
		if x - y == 1:
			print('NO')
		else:
			print('YES')
main()


import math

def isprime(x):
	if x == 1:
		return False
	if x == 2:
		return True
	z = int(math.sqrt(x))
	for j in range(2, z + 1):
		if x % j == 0:
			return False
	return True
t = int(input())
while t > 0:
	(x, y) = map(int, input().split(' '))
	left = x - y
	flag = 0
	if left != 1:
		flag = 1
	if flag:
		print('YES')
	else:
		print('NO')
	t = t - 1


for _ in range(int(input())):
	(x, y) = [int(__) for __ in input().split()]
	if x - y == 1:
		print('NO')
	else:
		print('YES')


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop, heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10 ** 9 + 7
inf = float('inf')

def I():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))
t = I()
for _ in range(t):
	(x, y) = LI()
	s = x - y
	if s == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for case in range(t):
	(x, y) = [int(s) for s in input().split(' ')]
	if x - y == 1:
		ans = 'NO'
	else:
		ans = 'YES'
	print(ans)


t = int(input())
for q in range(t):
	(x, y) = map(int, input().split())
	d = x - y
	if d == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(0, n):
	(a, b) = map(int, input().split())
	x = a - b
	if x != 1:
		if x % 2 == 0 or x % 3 == 0 or x % 5 == 0 or (x % 7 == 0) or (x % 11 == 0) or (x % 2 == 1) or (x % 3 == 1) or (x % 5 == 1) or (x % 7 == 1) or (x % 11 == 1):
			print('YES', end='\n')
	else:
		print('NO', end='\n')


t = int(input())
while t:
	(a, b) = [int(x) for x in input().split()]
	if a - b > 1:
		print('YES')
	else:
		print('NO')
	t -= 1


from math import sqrt
t = int(input())
for _ in range(t):
	(b, s) = list(map(int, input().split()))
	d = b - s
	ans = False
	if not d % 2:
		ans = True
	else:
		for i in range(3, d + 1, 2):
			ip = True
			for j in range(3, int(sqrt(i)) + 1, 2):
				if not i % j:
					ip = False
					break
			if ip:
				if not d % ip:
					ans = True
					break
	if ans:
		print('YES')
	else:
		print('NO')


def solution(p, q) -> None:
	if p - q > 1:
		print('YES')
	else:
		print('NO')

def main():
	t = int(input())
	for i in range(t):
		(p, q) = map(int, input().split())
		solution(p, q)
main()


from sys import stdin
for _ in range(int(stdin.readline())):
	(n, m) = map(int, stdin.readline().split())
	if n - m == 1:
		print('NO')
	else:
		print('YES')


import sys, atexit
from io import BytesIO
inp = BytesIO(sys.stdin.buffer.read())
input = lambda : inp.readline().decode('ascii')
buf = BytesIO()
atexit.register(lambda : sys.__stdout__.buffer.write(buf.getvalue()))
for i in range(int(input())):
	(x, y) = map(int, input().split())
	if abs(x - y) == 1:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	z = n - m
	if z == 1:
		print('NO')
	else:
		print('YES')


import sys
q = int(input())
for case in range(q):
	(x, y) = map(int, input().split())
	d = x - y
	if d % 2 == 0 or d % 3 == 0:
		print('YES')
	else:
		m = (d - 3) % 2
		if m == 0 and d != 1:
			print('YES')
		else:
			print('NO')
exit(0)


n = int(input())
for k in range(n):
	(x, y) = map(int, input().split())
	if x - y == 1:
		print('NO')
		continue
	print('YES')


import sys
input = sys.stdin.readline
q = int(input())
for testcases in range(q):
	(x, y) = map(int, input().split())
	if x > y + 1:
		print('YES')
	else:
		print('NO')


import sys
import bisect as b
import math
from collections import defaultdict as dd
input = sys.stdin.readline
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def computeGCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
for i in range(inin()):
	(x, y) = cin()
	if abs(x - y) == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	print(['YES', 'NO'][x == y + 1])


n = int(input())
for x in range(n):
	(int1, int2) = map(int, input().split())
	diff = int1 - int2
	if diff == 0 or diff == 1:
		print('NO')
	else:
		print('YES')


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	for _ in range(n):
		(x, y) = [int(x) for x in input().split()]
		if x - y == 1:
			print('NO')
		else:
			print('YES')
main()


t = int(input())
kq = []
for i in range(t):
	xy = [int(c) for c in input().split()]
	if xy[0] - xy[1] == 1:
		kq.append('NO')
	elif xy[0] - xy[1] != 1:
		kq.append('YES')
for i in range(t):
	print(kq[i])


def is_prime_number(number):
	for i in range(2, number):
		if number % i == 0:
			return False
	return True

def is_divided_by_prime_number(number):
	for i in range(2, number + 1):
		if is_prime_number(i) & number % i == 0:
			return True
	return False

def can_be_substracted(x, y):
	difference = x - y
	return 'YES' if is_divided_by_prime_number(difference) else 'NO'
test_cases = int(input())
responses = []
for i in range(0, test_cases):
	test_case = input()
	numbers = test_case.split()
	first_numer = int(numbers[0])
	second_numer = int(numbers[1])
	responses.append(can_be_substracted(first_numer, second_numer))
for response in responses:
	print(response)


test = int(input())
while test > 0:
	(m, n) = map(int, input().split())
	if m - n > 1:
		print('YES')
	else:
		print('NO')
	test -= 1


t = int(input())
ans = []
for i in range(t):
	(x, y) = list(map(int, input().split()))
	if x - y == 1:
		ans.append('NO')
	else:
		ans.append('YES')
for i in range(t):
	print(ans[i])


def subtract_prime(big, small):
	if big - small > 1:
		return 'YES'
	return 'NO'

def solution(inp1, inp2):
	return subtract_prime(inp1, inp2)

def main():
	inp1 = input()
	length = int(inp1)
	for i in range(length):
		inp = input().split()
		result = solution(int(inp[0]), int(inp[1]))
		print(result)
main()


t = int(input())
res = []
for _ in range(t):
	(a, b) = map(int, input().split())
	if a - b == 1:
		res.append('NO')
	else:
		res.append('YES')
for i in res:
	print(i)


t = int(input())
while t > 0:
	t -= 1
	x = input()
	lista = x.split()
	if int(lista[0]) - int(lista[1]) == 1:
		print('NO')
	else:
		print('YES')


from bisect import bisect_right as br
import sys
from collections import *
from math import *
import re

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	c = 0
	for i in range(2, n):
		if prime[i]:
			c += 1
	return c

def iseven(n):
	return [False, True][0 if n % 2 else 1]

def inp_arr():
	return list(map(int, input().split()))

def inp():
	return map(int, input().split())

def lcm(a, b):
	return a * b / gcd(a, b)
max_int = sys.maxsize
mod = 10 ** 9 + 7
t = int(input())
while t:
	(x, y) = inp()
	print(['YES', 'NO'][abs(x - y) == 1])
	t -= 1


for _ in range(int(input())):
	(n1, n2) = map(int, input().split())
	if n1 - n2 > 1:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(x, y) = [int(o) for o in input().split()]
	if x - y == 1:
		print('NO')
	else:
		print('YES')


read = lambda : [int(i) for i in input().split()]
t = int(input())
for _ in range(t):
	(x, y) = read()
	print('YES' if x - y > 1 else 'NO')


import math

def query(num):
	if num > 1:
		for i in range(2, num):
			if num % i == 0:
				return False
		else:
			return True
	else:
		return False

def main():
	for i in range(int(input())):
		(x, y) = map(int, input().split(' '))
		d = x - y
		t = str(d)
		if query(int(t[len(t) - 1])):
			if y + d == x:
				print('YES')
			else:
				print('NO')
		elif d == 1:
			print('NO')
		else:
			print('YES')
main()


t = int(input())
while t != 0:
	(a, b) = map(int, input().split())
	k = a - b
	if k == 1:
		print('NO')
	else:
		print('YES')
	t = t - 1


t = int(input())
p = 0
while p < t:
	p = p + 1
	(n, x) = map(int, input().split())
	y = n - x
	if y == 1:
		print('NO')
		continue
	else:
		print('YES')


mod = 10 ** 9 + 7
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
from random import randint as rn

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1

def main():
	t = inin()
	for _ in range(t):
		(n, m) = cin()
		if n - m == 1:
			print('NO')
		else:
			print('YES')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


for i in range(int(input())):
	(n, k) = list(map(int, input().split()))
	if n - k > 1:
		print('YES')
	else:
		print('NO')


import sys
import sys
for _ in range(int(input())):
	(x, y) = list(map(int, input().split()))
	if x - y > 1:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	if x - 2 >= y:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	x = list(map(int, input().split()))
	if x[0] - x[1] > 1:
		print('YES')
	else:
		print('NO')


for ii in range(int(input())):
	(nn, m) = map(int, input().split())
	if nn - m == 1:
		print('NO')
	else:
		print('YES')


test_cases = int(input())
for i in range(test_cases):
	(a, b) = map(int, input().split(' '))
	if a - b >= 2:
		print('YES')
	else:
		print('NO')


R = lambda : map(int, input().split())
(t,) = R()
for _ in range(t):
	(x, y) = R()
	print('YNEOS'[x - y < 2::2])


import sys
readline = sys.stdin.readline
Q = int(readline())
Ans = [None] * Q
for qu in range(Q):
	(x, y) = map(int, readline().split())
	if x - y == 1:
		Ans[qu] = 'NO'
	else:
		Ans[qu] = 'YES'
print('\n'.join(Ans))


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
for _ in range(ii()):
	(a, b) = f()
	if a - b != 1:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	k = [int(s) for s in input().split()]
	re = k[0] - k[1]
	if re == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
while n > 0:
	n -= 1
	(k1, k2) = [int(i) for i in input().split()]
	if k1 - k2 > 1:
		print('YES')
	else:
		print('NO')


def solve(x, y):
	temp = x - y
	if temp == 1:
		print('NO')
	else:
		print('YES')

def main():
	t = int(input())
	for i in range(t):
		ipt = input().split()
		solve(int(ipt[0]), int(ipt[1]))
main()


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(a, b) = MAP()
	if a - b != 1:
		YES()
	else:
		NO()


for i in range(int(input())):
	(pc, pr) = map(int, input().split())
	if abs(pc - pr) < 2:
		print('NO')
	else:
		print('YES')


def f(x, y):
	if x - y == 1:
		return 'NO'
	else:
		return 'YES'
nt = int(input())
ans = []
for i in range(nt):
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	ans.append(f(x, y))
for i in ans:
	print(i)


t = int(input())
res = []
for _ in range(t):
	k = input().split()
	x = int(k[0])
	y = int(k[1])
	if x - y == 1 or y - x == 1:
		res.append('NO')
	else:
		res.append('YES')
for i in range(t):
	print(res[i])


T = int(input())
for _ in range(T):
	(X, Y) = map(int, input().split())
	print('YES' if X - Y != 1 else 'NO')


for j in range(int(input())):
	(x, y) = list(map(int, input().split()))
	if x - y == 1:
		print('NO')
	else:
		print('YES')


import math

class Solution:

	def solution(self):
		(x, y) = map(int, input().strip().split())
		if x - y == 1:
			print('NO')
		else:
			print('YES')
for _ in range(int(input())):
	ob = Solution()
	ob.solution()


from math import sqrt, ceil

def main():
	for _ in range(int(input())):
		(x, y) = map(int, input().split())
		if x - y == 1:
			ans = 'NO'
		else:
			ans = 'YES'
		print(ans)
main()


t = int(input())
res = []
for i in range(t):
	(x, y) = map(int, input().split())
	if x - y > 1:
		res.append('YES')
	else:
		res.append('NO')
for j in res:
	print(j)


t = int(input())
while t > 0:
	(x, y) = map(int, input().split())
	r = x - y
	if r % 2 == 0:
		print('YES')
	elif r > 1:
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
for i in range(0, t):
	arr = input()
	l = list(map(int, arr.split(' ')))
	diff = l[0] - l[1]
	if diff < 2:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	(n, k) = [int(i) for i in input().split()]
	if n - k == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
while t > 0:
	(x, y) = list(map(int, input().split()))
	if x - y > 1:
		print('YES')
	elif x - y == 1:
		print('NO')
	t -= 1


import sys
INT_MAX = sys.maxsize
INT_MIN = -sys.maxsize
sys.setrecursionlimit(10 ** 7)
mod = 1000000007

def IOE():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	t = int(sys.stdin.readline())
	for _ in range(t):
		(a, b) = map(int, sys.stdin.readline().split())
		if a - b >= 2:
			sys.stdout.write(str('YES') + '\n')
		else:
			sys.stdout.write(str('NO') + '\n')
try:
	IOE()
except:
	pass
main()


n = input()
n = int(n)
A = []
S = []
for i in range(n):
	A.append(list(map(int, input().split())))
for i in A:
	r = i[0] - i[1]
	if r == 1:
		S.append('NO')
	else:
		S.append('YES')
for i in S:
	print(i)


def two_three(x):
	if x == 1:
		return 'YES'
	elif x >= 5:
		return two_three(x - x // 5)
	elif x >= 3:
		return two_three(x - x // 3)
	elif x >= 2:
		return two_three(x - x // 2)
	else:
		return 'NO'
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x - y == 0:
		print('YES')
	elif x - y < 2:
		print('NO')
	else:
		print(two_three(abs(x - y)))


a = int(input())
for _ in range(a):
	(b, c) = [int(i) for i in input().split()]
	if b - 1 != c:
		print('YES')
	else:
		print('NO')


for rpt in range(int(input())):
	(x, y) = [int(x) for x in input().split(' ')]
	if x > y + 1:
		print('YES')
	else:
		print('NO')


import time
t = int(input())
ans = []
start = time.time()
for i in range(t):
	(x, y) = (int(i) for i in input().split())
	if x - y == 1:
		ans.append('NO')
	else:
		ans.append('YES')
for i in range(t):
	print(ans[i])
finish = time.time()


t = int(input())
for i in range(t):
	a = [int(i) for i in input().split()]
	if a[0] - a[1] == 1:
		print('NO')
	else:
		print('YES')


def f():
	(p, q) = list(map(int, input().split()))
	x = p - q
	if x == 1:
		return 'NO'
	else:
		return 'YES'
n = int(input())
re = []
for i in range(0, n):
	re.append(f())
for i in re:
	print(i)


r = int(input())
g = []
for i in range(0, r):
	(x, y) = map(int, input().split())
	if x - y <= 1:
		g.append('NO')
	else:
		g.append('YES')
print('\n'.join(g))


for i in range(int(input())):
	(num1, num2) = map(int, input().split())
	if num1 + 1 == num2 or num1 - 1 == num2:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(0, t):
	(x, y) = [int(x) for x in input().split()]
	if x - y > 1:
		print('YES')
	elif x - y == 1:
		print('NO')


l = []

def Sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	for p in range(n + 1):
		if prime[p]:
			l.append(p)
Sieve(100000)
n = int(input())
while n != 0:
	flag = False
	(x, y) = map(int, input().strip().split())
	div = x - y
	if div == 1:
		flag = False
	else:
		flag = True
	if flag:
		print('YES')
	else:
		print('NO')
	n -= 1


Q = int(input())
for q in range(Q):
	(a, b) = tuple(map(int, input().split()))
	if a - b == 1:
		print('NO')
	else:
		print('YES')


test = int(input())
while test > 0:
	test -= 1
	(x, y) = map(int, input().split())
	if x - y >= 2:
		print('YES')
	else:
		print('NO')


def subs(x, y):
	diff = x - y
	if diff == 1:
		return 'NO'
	return 'YES'
t = int(input())
for i in range(t):
	(x, y) = list(map(int, input().rstrip().split()))
	print(subs(x, y))


from collections import defaultdict as df
from sys import stdin, stdout
import math

def prime(n):
	if n == 2 or n == 3:
		return 1
	if n % 2 == 0 or n % 3 == 0 or n == 1:
		return 0
	g = math.sqrt(n)
	g = int(g)
	w = 2
	for i in range(5, g + 1, w):
		if n % i == 0:
			return 0
		w = 6 - w
	return 1
q = int(stdin.readline())
for i in range(q):
	(a, b) = list(map(int, stdin.readline().split()))
	diff = a - b
	if diff == 1:
		stdout.write('NO')
	else:
		stdout.write('YES')
	stdout.write('\n')


N = int(input())
m = 0
while m < N:
	(x, y) = map(int, input().split())
	if x - y == 1:
		print('NO')
	else:
		print('YES')
	m += 1


from sys import stdin
t = int(stdin.readline().rstrip())
while t > 0:
	(x, y) = map(int, stdin.readline().split())
	if x - y != 1:
		print('YES')
	else:
		print('NO')
	t -= 1


tc = int(input())
while tc > 0:
	(n1, n2) = [int(x) for x in input().split()]
	d = n1 - n2
	if d == 1:
		print('NO')
	else:
		print('YES')
	tc -= 1


import sys
import math
from collections import *
from functools import reduce
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def li():
	return [int(i) for i in input().rstrip('\n').split(' ')]

def val():
	return int(input().rstrip('\n'))

def st():
	return input().rstrip('\n')

def sttoli():
	return [int(i) for i in input().rstrip('\n')]

def gcdfinder():
	l = []
	for i in range(1, 7001):
		temp = []
		for j in range(1, 7001):
			temp.append(math.gcd(i, j))
		l.append(temp)
	return l
for _ in range(val()):
	(x, y) = li()
	if x - 2 < y:
		print('NO')
	else:
		print('YES')


n = int(input())
res = []
for i in range(n):
	s = [int(x) for x in input().split()]
	if s[0] - s[1] > 1:
		res.append('YES')
	else:
		res.append('NO')
for i in range(n):
	print(res[i])


def parseInt(s):
	return int(s)

def h():
	arrlen = int(input())
	res = ''
	for i in range(arrlen):
		arr = list(map(parseInt, input().split()))
		if arr[0] - arr[1] > 1:
			res += 'YES\n'
		else:
			res += 'NO\n'
	print(res[:-1])
h()


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print('YNEOS'[a - b == 1::2])


n = int(input())
for i in range(n):
	num = list(map(int, input().split()))
	x = num[0]
	y = num[1]
	if x - y == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	n = [int(j) for j in input().split()]
	difference = n[0] - n[1]
	if difference > 1:
		print('YES')
	else:
		print('NO')


q = int(input())
while q != 0:
	q -= 1
	n = input()
	new_list = n.split(' ')
	(a, b) = (int(new_list[0]), int(new_list[1]))
	if a - b == 1:
		print('NO')
	else:
		print('YES')


import math
for q in range(int(input())):
	a = 0
	(x, y) = map(int, input().split())
	res = x - y
	if res != 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for x in range(0, t):
	(a, b) = map(int, input().split())
	if a - b == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for nt in range(t):
	(x, y) = map(int, input().split())
	num = x - y
	if num == 1:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	s = str(input())
	l = s.split(' ')
	if int(l[0]) - int(l[1]) == 1:
		print('NO')
	else:
		print('YES')


for t in range(int(input())):
	(a, b) = map(int, input().split())
	if not a - b == 1 and (not b - a == 1):
		print('YES')
	else:
		print('NO')


for _ in [0] * int(input()):
	(x, y) = map(int, input().split())
	print('YNEOS'[x - y < 2::2])


import math
input0 = int(input())
inputs = []
for i in range(0, input0):
	tempC = ''
	input1 = input()
	inputs.append([])
	for c in input1:
		if c == ' ':
			inputs[i].append(int(tempC))
			tempC = ''
		else:
			tempC += c
	inputs[i].append(int(tempC))
	tempC = ''
for p in inputs:
	if p[0] - p[1] > 1:
		print('YES')
	else:
		print('NO')


from math import ceil, sqrt

def func(a, b):
	d = a - b
	if d == 1:
		return 'NO'
	else:
		return 'YES'
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	print(func(a, b))


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = int(input())
for tt in range(t):
	(x, y) = map(int, sys.stdin.readline().split(' '))
	d = x - y
	if d % 2 == 0:
		print('YES')
	else:
		d -= 3
		if d >= 0:
			print('YES')
		else:
			print('NO')
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


t = int(input())
while t > 0:
	a = [int(x) for x in input().split()]
	x = a[0]
	y = a[1]
	diff = x - y
	if diff > 1:
		print('YES')
	else:
		print('NO')
	t -= 1


from sys import stdin

def scal(typ=int):
	return typ(stdin.readline())

def vec(typ=int):
	if isinstance(typ, list):
		inp = stdin.readline().split()
		return [typ[i](inp[i]) for i in range(len(inp))]
	else:
		return list(map(typ, stdin.readline().split()))
t = scal()
for _ in range(t):
	(x, y) = vec()
	print('YES' if y < x - 1 else 'NO')


for j in range(int(input())):
	(x, y) = [int(e) for e in input().split()]
	if x - y == 1:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	a = x - y
	s = 1
	k = 2
	l = 1
	while k != 1:
		l += 1
		if k % l == 0:
			k //= l
			s += 1
			if s > 2:
				break
	if a < l:
		print('NO')
	elif a % k == 0 and s == 2:
		print('YES')
	else:
		s = 1
		k += 1
		l = 1


n = int(input())
A = [list(map(int, input().split())) for _ in range(n)]
A_dif = [A[i][0] - A[i][1] for i in range(len(A))]
for k in range(len(A_dif)):
	if A_dif[k] >= 2:
		print('YES')
	else:
		print('NO')


for i in '0' * int(input()):
	(x, y) = map(int, input().split())
	print('YES' if x - y >= 2 else 'NO')


for i in [0] * int(input()):
	(x, y) = map(int, input().split())
	print('YNEOS'[x - y <= 1::2])


def solve(x, y):
	(x, y) = (max(x, y), min(x, y))
	diff = x - y
	if diff <= 1:
		return 'NO'
	else:
		return 'YES'
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print(solve(x, y))


for i in range(int(input())):
	(X, Y) = map(int, input().split())
	if X - Y < 2:
		print('NO')
	else:
		print('YES')


k = int(input())
for a in range(k):
	list_of_2_numbers = list(map(int, input().split()))
	difference = list_of_2_numbers[0] - list_of_2_numbers[1]
	if difference == 1:
		print('NO')
	else:
		print('YES')


T = int(input())
for _ in range(T):
	(x, y) = list(map(int, input().split()))
	val = x - y
	if x - y == 1:
		print('NO')
	else:
		print('YES')


import sys
sys.setrecursionlimit(200000)
LI = lambda : list(map(int, sys.stdin.readline().split()))
MI = lambda : map(int, sys.stdin.readline().split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline())
ans = ['NO', 'YES']
for _ in range(II()):
	(a, b) = MI()
	print(ans[int(a - b != 1)])


import sys
it = 0
for line in sys.stdin:
	it = it + 1
	line = line.rstrip()
	if it == 1:
		continue
	first = int(line.split(' ')[0])
	second = int(line.split(' ')[1])
	if first - second == 1:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(x, y) = [int(i) for i in input().split()]
	res = x - y
	if res != 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(x, y) = [int(z) for z in input().split()]
	diff = x - y
	if diff < 2:
		print('NO')
	else:
		print('YES')


from math import *
from sys import *
from heapq import *
from collections import defaultdict
import os, sys
from io import IOBase, BytesIO
M = 10 ** 9 + 7

def pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def powmod(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a *= a
		b >>= 1
	return res

def inv(a, m):
	return powmod(a, m - 2, m)

def alldivisors(n):
	list = []
	arr = []
	for i in range(1, int(sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				arr += [i]
			else:
				arr += [i]
				list.append(n // i)
	arr += list[::-1]
	return arr

def primefactorisation(n):
	potentional_p = 3
	itog_list = defaultdict(int)
	if n % 2 == 0:
		itog_list[2] = 0
	while n % 2 == 0:
		n = n // 2
		itog_list[2] += 1
	while n - 1:
		if potentional_p > n ** 0.5:
			itog_list[n] += 1
			return itog_list
		while n % potentional_p == 0:
			n = n // potentional_p
			itog_list[potentional_p] += 1
		potentional_p += 2
	return itog_list

def main():
	t = int(input())
	for _ in range(t):
		(x, y) = list(map(int, input().split()))
		if x - y == 1:
			print('NO')
		else:
			print('YES')
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if a - b == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	c = x - y
	z = 0
	l = 0
	if c > 10:
		c = c // 2
	for i in range(1, c):
		if c % i == 0:
			z = 0
			if i != 2 and i != 3 and (i != 4) and (i != 5):
				for k in range(2, i // 2):
					if i % k == 0:
						z += 1
			else:
				if i == 2:
					print('YES')
					l = 1
					break
				if i == 3:
					print('YES')
					l = 1
					break
				if i == 5:
					print('YES')
					l = 1
					break
		if z == 0:
			print('YES')
			l = 1
			break
	if l == 0:
		print('NO')


from math import sqrt
for z in range(int(input())):
	(x, y) = map(int, input().split())
	diff = x - y
	if diff != 1:
		print('YES')
	else:
		print('NO')


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
t = rint()
for _ in range(t):
	(x, y) = rints()
	print('YES' if x - y > 1 else 'NO')


n = int(input())
for x in range(n):
	(a, b) = list(map(int, input().split()))
	if a - b == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	dif = x - y
	output = 'YES'
	if dif == 1:
		output = 'NO'
	print(output)


import sys
from collections import defaultdict
from math import sqrt
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def s(d):
	dis = 1 + 4 * 2 * 3 * d
	ds = sqrt(dis)
	return (-1 + ds) / 6

def main():
	n = inp()
	for i in range(n):
		(a, b) = inlt()
		d = a - b
		if d > 1:
			print('YES')
		else:
			print('NO')
main()


def is_prime_number(number):
	for i in range(2, number):
		if number % i == 0:
			return False
	return True

def is_divided_by_prime_number(number):
	for i in range(2, number + 1):
		if is_prime_number(i) & number % i == 0:
			return True
	return False

def can_be_substracted_with_primes(firstNumber, secondNumber):
	difference = firstNumber - secondNumber
	return 'YES' if is_divided_by_prime_number(difference) else 'NO'
test_cases = int(input())
for i in range(0, test_cases):
	test_case = input()
	numbers = test_case.split()
	first_numer = int(numbers[0])
	second_numer = int(numbers[1])
	print(can_be_substracted_with_primes(first_numer, second_numer))


testCases = int(input())
for t in range(testCases):
	(x, y) = tuple(map(int, input().split(' ')))
	sub = x - y
	if sub > 1:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	if x == y:
		print('YES')
	elif x - y != 1:
		print('YES')
	else:
		print('NO')


__author__ = 'Esfandiar'
for i in range(int(input())):
	(x, y) = map(int, input().split())
	x -= y
	if x > 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for ti in range(t):
	(a, b) = (int(i) for i in input().split(' '))
	if a - 1 == b:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	x = list(map(int, input().split()))
	print(['NO', 'YES'][x[0] - x[1] > 1])


n = int(input())
for i in range(n):
	s = input()
	mas = s.split()
	if int(mas[1]) + 1 == int(mas[0]):
		print('NO')
	else:
		print('YES')


n = int(input())
for cases in range(n):
	(x, y) = map(int, input().split())
	if x - y > 1:
		print('YES')
	else:
		print('NO')


t = int(input(''))
for _ in range(t):
	a = input('').split(' ')
	x = int(a[0])
	y = int(a[1])
	if x - y == 1:
		print('NO')
		continue
	print('YES')


t = int(input())
ans = []

def is_simple(n):
	if n % 2 == 0:
		return n == 2
	d = 3
	while d * d <= n and n % d != 0:
		d += 2
	return d * d > n
for i in range(t):
	(x, y) = map(int, input().split())
	a = x - y
	for j in range(1, a):
		if is_simple(j):
			if a % j == 0:
				ans.append('YES')
				break
	if len(ans) == i:
		ans.append('NO')
print(*ans, sep='\n')


import sys
input = sys.stdin.buffer.readline
t = int(input())
for i in range(t):
	(a, b) = [int(item) for item in input().split()]
	if a - b > 1:
		print('YES')
	else:
		print('NO')


t = int(input())
xy_array = [[int(x) for x in input().split()] for y in range(t)]
for (x, y) in xy_array:
	print('YES' if x - y != 1 else 'NO')


t = int(input())
for e in range(t):
	[x, y] = [int(i) for i in input().split()]
	if x - y == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
ans = []
for i in range(0, n):
	(num1, num2) = list(map(int, input().split()))
	if num1 - num2 < 2:
		ans.append('NO')
	else:
		ans.append('YES')
for i in ans:
	print(i)


for itr in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if abs(a - b) == 1:
		print('NO')
	else:
		print('YES')


querys = int(input())
for i in range(querys):
	(x, y) = (int(j) for j in input().split(' '))
	if x - y >= 2:
		print('YES')
	else:
		print('NO')


Answers = []
for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a - b != 1:
		Answers.append('YES')
	else:
		Answers.append('NO')
for i in Answers:
	print(i)


import math
result = []

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for i in range(int(input())):
	a = [int(i) for i in input().split()]
	x = a[0]
	y = a[1]
	diff = x - y
	if diff == 1:
		result.append('NO')
	else:
		result.append('YES')
for i in result:
	print(i)


import math

def check(n):
	for i in range(2, int(math.sqrt(n))):
		if n % i == 0:
			return False
	return True
t = int(input())
while t > 0:
	t -= 1
	(x, y) = map(int, input().split())
	diff = x - y
	if diff == 1:
		print('NO')
	else:
		print('YES')


from sys import stdin, stdout
import heapq
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warm_up = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n
		self.lista = [[_] for _ in range(n)]

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]
		self.lista[a] += self.lista[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def prime_factors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def fibonacci_modP(n, MOD):
	if n < 2:
		return 1
	return (cached_fn(fibonacci_modP, (n + 1) // 2, MOD) * cached_fn(fibonacci_modP, n // 2, MOD) + cached_fn(fibonacci_modP, (n - 1) // 2, MOD) * cached_fn(fibonacci_modP, (n - 2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * cached_fn(InverseEuler, i, p) % p
	return res

def binary(n, digits=20):
	b = bin(n)[2:]
	b = '0' * (digits - len(b)) + b
	return b

def is_prime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def generate_primes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	return prime
factorial_modP = []

def warm_up_fac(MOD):
	global factorial_modP, fac_warm_up
	if fac_warm_up:
		return
	factorial_modP = [1 for _ in range(fac_warm_up_size + 1)]
	for i in range(2, fac_warm_up_size):
		factorial_modP[i] = factorial_modP[i - 1] * i % MOD
	fac_warm_up = True

def InverseEuler(n, MOD):
	return pow(n, MOD - 2, MOD)

def nCr(n, r, MOD):
	global fac_warm_up, factorial_modP
	if not fac_warm_up:
		warm_up_fac(MOD)
		fac_warm_up = True
	return factorial_modP[n] * (pow(factorial_modP[r], MOD - 2, MOD) * pow(factorial_modP[n - r], MOD - 2, MOD) % MOD) % MOD

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def ncr(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def binary_search(i, li):
	fn = lambda x: li[x] - x // i
	x = -1
	b = len(li)
	while b >= 1:
		while b + x < len(li) and fn(b + x) > 0:
			x += b
		b = b // 2
	return x
TestCases = True
optimise_for_recursion = True

def main():
	(x, y) = get_tuple()
	print('YES') if x > y + 1 else print('NO')
if TestCases:
	for i in range(get_int()):
		main()
else:
	main() if not optimise_for_recursion else threading.Thread(target=main).start()


import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
sys.setrecursionlimit(100000)
input = sys.stdin.readline

def read_int():
	return int(input())

def read_int_n():
	return list(map(int, input().split()))

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

def is_prime(n):
	if n == 1:
		return False
	if n == 2:
		return True
	for k in range(100):
		a = random.randint(2, n - 1)
		if gcd(n, a) != 1:
			return False
		if pow(a, n - 1, n) != 1:
			return False
	return True

def gcd(a, b):
	while b > 0:
		(a, b) = (b, a % b)
	return a

@mt
def slv(X, Y):
	X -= Y
	if X == 1:
		return 'NO'
	return 'YES'

def main():
	T = read_int()
	for _ in range(T):
		(X, Y) = read_int_n()
		print(slv(X, Y))
main()


till = 1000001
prime = [True for i in range(till)]
root = 1001
for i in range(2, root):
	if prime[i] == True:
		for j in range(i + i, till, i):
			prime[j] = False
li = []
for i in range(2, till):
	if prime[i] == True:
		li.append(i)
test = int(input())
for testcase in range(test):
	arr = [int(x) for x in input().split()]
	(x, y) = (arr[0], arr[1])
	if y + 1 == x:
		print('NO')
	else:
		print('YES')


tc = int(input())

def p(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5)):
		if n % i == 0:
			return False
	return True
for _ in range(tc):
	(x, y) = map(int, input().split())
	ans = 'YES'
	tmp = x - y
	if tmp <= 1:
		ans = 'NO'
	print(ans)


from math import floor
t = int(input())
while t > 0:
	temp = input().split()
	x = int(temp[0])
	y = int(temp[1])
	if x == y or x - y == 1:
		print('NO')
	else:
		print('YES')
	t -= 1


for i in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	d = a - b
	if d == 1 or d == 0:
		print('NO')
	else:
		print('YES')


n = int(input())
N = []
for i in range(n):
	(x, y) = map(int, input().split())
	q = x - y
	if q == 1:
		r = 'NO'
	else:
		r = 'YES'
	N.append(r)
for h in N:
	print(h)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print('YNEOS'[x - y == 1::2])


for i in range(int(input())):
	x = [int(x) for x in input().split()]
	if abs(x[0] - x[1]) > 1:
		print('YES')
	else:
		print('NO')


import array
import math
import os
import sys
DEBUG = 'DEBUG' in os.environ

def inp():
	return sys.stdin.readline().rstrip()

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)

def main():
	T = int(inp())
	for _ in range(T):
		(X, Y) = [int(e) for e in inp().split()]
		if X - Y < 2:
			print('NO')
		else:
			print('YES')
main()


def main():
	l = []
	t = int(input())
	for i in range(t):
		x = input().split(' ')
		x = list(map(lambda e: int(e), x))
		if x[0] - x[1] > 1:
			l.append('YES')
		elif x[0] - x[1] <= 1:
			l.append('NO')
	for i in l:
		print(i)
main()


a = int(input())
s = []
for i in range(a):
	s.append(input().split())
for i in s:
	if int(i[0]) - int(i[1]) == 1:
		print('NO')
	else:
		print('YES')


n = int(input().strip())
for i in range(n):
	arr = input().strip().split(' ')
	one = int(arr[0])
	two = int(arr[1])
	if one - two <= 1:
		print('NO')
	else:
		print('YES')


elem = int(input())
for x in range(elem):
	ar = []
	for t in input().split(' '):
		ar.append(int(t))
	temp = ar[0] - ar[1]
	if temp > 1:
		print('YES')
	else:
		print('NO')


from math import gcd, ceil
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
inp = lambda : int(stdin.readline())
sip = lambda : stdin.readline()
mulip = lambda : map(int, stdin.readline().split())
lst = lambda : list(map(int, stdin.readline().split()))
slst = lambda : list(sip())
M = pow(10, 9) + 7
for _ in range(inp()):
	(x, y) = mulip()
	d = x - y
	if d == 1:
		print('NO')
	else:
		print('YES')