3.2 Prime Dreams
(RankList for this Question)
Score: 60pts
Time Limit: 3.00 sec
It was Saturday night and it was raining heavily outside. You were inside your room studying maths. Prime numbers have always fascinated you.
You were studying the Legendary Noldbach Problem which states :
Every Integer greater then 2 can be expresses as sum of two primes.

You tried proving this theorem and played with it by testing various even numbers. Exactly at 11:59 (prime time), you went to your bed to get some sleep. In your dreams, you saw prime numbers revolving everywhere around you.

The next morning,you sat on your desk and suddenly out of nowhere you came up with a statement that : There exists atleast k prime numbers between 2 to n (inclusive) such that they can be expressed as sum of two neighbouring prime numbers and 1.
19 = 11 + 7 + 1
13 = 5 + 7 + 1
Two primes are said to be neighbouring primes if there are no other primes in between them. You are unable to prove this statement so you decided to check it out on various test cases.
So given n and k check if the above statement holds true.

The first line contains the number of Test cases (T). 1 <= T <= 100
The next t line of the input contains two integers n (2 ≤ n ≤ 1000) and k (0 ≤ k ≤ 1000).
Sum of n over all test cases wont exceed 10^5.

Input Format
T integers

Output Format
Output YES if at least k prime numbers from 2 to n inclusively can be expressed as it was described above. Otherwise output NO.

Example 1
27 2
45 7


In the first example we have 13 and 19 as 2 numbers which can be expressed according to given conditions.
For the second example there are no integers between the expected range.

Log In to solve the Question