On the eve of Teddy Day Chotu decided to buy a teddy for his girlfriend Choti. He has N coins each having distinct value from 1 to N. Now after collecting all the coins he went to buy a Teddy. 

Now the shopkeeper Motu told Chotu that there is only one Teddy in the shop of Value K. As Chotu is very bhondu(idiot) he wonders whether he can buy that teddy or not. As you are Chotu's friend, help him solve the problem.

Input

First line contains integer T denoting number of testcases. 

Second line contains two integer N and K denoting values of coins and value of Teddy respectively.

Output

For each test case print "YES" if chotu can buy teddy else "NO" without quotes.

Constraints

1 ≤ T ≤ 100 

1 ≤ N ≤ 10^8

1 ≤ K ≤ 10^18

SAMPLE INPUT
2
5 8
4 20

SAMPLE OUTPUT
YES
NO

Explanation

In the first case Chotu can use coins of value  3 and 5 to make 8.

In the second case Chotu cannot make the desired value.
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
t=input()
while t>0:
	t-=1
	m,n=map(int,raw_input().split())
	if n<=(m*(m+1))/2:
		print"YES"
	else:
		print"NO"