PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000053. Bài toán Noldbach (Noldbach Problem)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Bài toán Noldbach (Noldbach Problem)

Noldbach Problem

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Two primes p,qp,q are called consecutive primes if no other prime lies strictly between them. A prime rr qualifies if r=p+q+1r=p+q+1 for some consecutive primes p,qp,q. Given n,kn,k, determine whether there are at least kk distinct qualifying primes in [2,n][2,n].

Input

One line containing integers nn and kk.

Output

Print YES if at least kk qualifying primes exist; otherwise print NO.

Subtasks

  • Subtask 1 (20 points): 2≤n≤1002\le n\le 100; 0≤k≤10000\le k\le 1000.
  • Subtask 2 (30 points): 2≤n≤4002\le n\le 400; 0≤k≤10000\le k\le 1000.
  • Subtask 3 (50 points): 2≤n≤10002\le n\le 1000; 0≤k≤10000\le k\le 1000.

Examples

Input

27 2

Output

YES

Explanation

The consecutive-prime pairs (5,7)(5,7) and (7,11)(7,11) produce 5+7+1=135+7+1=13 and 7+11+1=197+11+1=19. Both are primes at most 2727, providing at least two qualifying primes, so print YES.