codeparrot/codecomplex huggingface dataset:
// Problem: 701_C. They Are Everywhere
// Time complexity: linear
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.HashMap;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rene
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            String s = in.next();
            HashMap<Character, Integer> indexMap = new HashMap<>();
            for (int i = 0; i < n; i++) {
                char c = s.charAt(i);
                if (!indexMap.containsKey(c)) {
                    indexMap.put(c, indexMap.size());
                }
            }
            int[] last = new int[indexMap.size()];
            Arrays.fill(last, -1_000_000);
            int answer = n;
            for (int i = 0; i < n; i++) {
                int index = indexMap.get(s.charAt(i));
                last[index] = i;
                int first = i;
                for (int a : last) first = Math.min(first, a);
                int visits = i - first + 1;
                answer = Math.min(answer, visits);
            }
            out.println(answer);
        }

    }
}
// Problem: 701_C. They Are Everywhere
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Scanner;
import java.util.TreeSet;

public class Main3 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int N = sc.nextInt();
        String S = sc.next();
        HashSet<Character> unique = new HashSet<>();
        for(char c : S.toCharArray()){
            unique.add(c);
        }
        int number = unique.size();

        Hashtable<Character, Integer> indexes = new Hashtable<>();
        TreeSet<Integer> tree = new TreeSet<>();

        int min = N+1;
        int total = 0;
        for(int i = 0; i<N; i++){
            char c = S.charAt(i);
            if(!indexes.containsKey(c)){
                total++;
                indexes.put(c, i);
                tree.add(i);
            }
            else{
                int old = indexes.get(c);
                indexes.put(c, i);
                tree.remove(old);
                tree.add(i);
            }

            if(total == number){
                int dist = tree.last() - tree.first() + 1;
                min = Math.min(dist, min);
            }
        }

        System.out.println(min);
    }
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.util.*;

public class Main implements Runnable {

	public void _main() throws IOException {
		int n = nextInt();
		int k = nextInt();
		boolean[] p = new boolean[n + 1];
		Arrays.fill(p, true);
		List<Integer> primes = new ArrayList<Integer>();
		for (int i = 2; i <= n; i++)
			if (p[i]) {
				primes.add(i);
				for (int j = i + i; j <= n; j += i)
					p[j] = false;
			}
		boolean[] ok = new boolean[n + 1];
		for (int i = 0; i < primes.size() - 1; i++) {
			int x = primes.get(i);
			int y = primes.get(i + 1);
			if (x + y + 1 <= n)
				ok[x + y + 1] = true;
		}
		for (int i = 2; i <= n; i++)
			if (p[i] && ok[i]) {
				--k;				
			}		
		out.println(k <= 0 ? "YES" : "NO");
	}

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	private String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String rl = in.readLine();
			if (rl == null)
				return null;
			st = new StringTokenizer(rl);
		}
		return st.nextToken();
	}

	private int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	private long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	private double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public static void main(String[] args) {
		new Thread(new Main()).start();
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			_main();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(202);
		}
	}

}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {
	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;
	
		
	void solve() throws IOException {
		int n=ni();
		int k=ni();
		boolean[] t = new boolean[n+1];
		for(int i=2;i<=n;i++){
		t[i]=false;
		}
		int p=2;
		
		while(true){
			int pointer=2;
		while(pointer*p<=n){
			t[pointer*p]=true;
			pointer++;
		}

		boolean flag=false;
		for(int i=p+1;i<=n;i++){
			if(!t[i]){p=i;flag=true;break;}
		}
		if(!flag)break;
		}
		List<Integer> lst=new ArrayList<Integer>();

		int countN=0;
		for(int i=1;i<=n;i++){
			if(!t[i]){lst.add(i);countN++; }
		}
		int count=0;
		
		String resulPO="NO";
		for(int i=2;i<countN;i++){
			
			boolean result=false;
			for(int j=0;j<i;j++){
				if(lst.get(j)+lst.get(j+1)+1==lst.get(i)){
					result=true;
					//out.println(lst.get(j)+"+"+lst.get(j+1)+"+"+1+"=="+lst.get(i));
					break;
				}
			}
			if(result)count++;
		}
		if(count>=k)resulPO="YES";
		else resulPO="NO";
		out.print(resulPO);
		
	}
	
	public Main() throws IOException {
		Locale.setDefault(Locale.US);
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		in.close();
		out.close();
	}

	String ns() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

	int ni() throws IOException {
		return Integer.valueOf(ns());
	}

	long nl() throws IOException {
		return Long.valueOf(ns());
	}

	double nd() throws IOException {
		return Double.valueOf(ns());
	}

	public static void main(String[] args) throws IOException {
		new Main();
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

public class a {
	
	boolean[] isp;
	ArrayList<Integer> primes;

	private void solve() throws Exception {
		int n = nextInt();
		int k = nextInt();
		int cnt = 0;
		primes = new ArrayList<Integer>();
		isp = new boolean[n + 1];
		Arrays.fill(isp, true);
		for (int i = 2; i <= n; ++i) {
			for (int j = 2; j * j <= i; ++j)
				if (i % j == 0)
					isp[i] = false;
			if (isp[i])
				primes.add(i);
		}
		for (int i = 2; i <= n; ++i)
			if (isp[i]) {
				boolean can = false;
				for (int j = 0; j < primes.size() - 1; ++j) {
					int sum = primes.get(j) + primes.get(j + 1) + 1;
					if (i == sum)
						can = true;
				}
				if (can)
					++cnt;
			}
		if (cnt >= k)
			out.print("YES");
		else
			out.print("NO");
	}

	public void run() {
		try {
			solve();
		} catch (Exception e) {
			NOO(e);
		} finally {
			out.close();
		}
	}

	PrintWriter out;
	BufferedReader in;
	StringTokenizer St;

	void NOO(Exception e) {
		e.printStackTrace();
		System.exit(1);
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	String nextToken() {
		while (!St.hasMoreTokens()) {
			try {
				String line = in.readLine();
				St = new StringTokenizer(line);
			} catch (Exception e) {
				NOO(e);
			}
		}
		return St.nextToken();
	}

	private a(String name) {
		try {
			in = new BufferedReader(new FileReader(name + ".in"));
			St = new StringTokenizer("");
			out = new PrintWriter(new FileWriter(name + ".out"));
		} catch (Exception e) {
			NOO(e);
		}
	}

	private a() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			St = new StringTokenizer("");
			out = new PrintWriter(System.out);
		} catch (Exception e) {
			NOO(e);
		}
	}

	public static void main(String[] args) {
		Locale.setDefault(Locale.US);
		new a().run();
	}

}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
//package round17;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;

public class A {

	static StreamTokenizer in =
		new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
	
	static int nextInt() throws IOException{
		in.nextToken();
		return (int)in.nval;
	}
	
	static PrintWriter out = new PrintWriter(System.out);
	
	static boolean prime(int n){
		int j = 2;
		while (j*j <= n)
			if (n%j == 0) return false;
			else j++;
		
		return true;
	}
	
	public static void main(String[] args) throws IOException{
		int n = nextInt(),
			k = nextInt(),
			a[] = new int[n];

		int s = 0;
		for (int i=2; i<=n; i++)
			if (prime(i))
				a[s++] = i;
		
		int m = 0;
		for (int i=2; i<s; i++)
			for (int j=i-1; j>0; j--)
				if (a[i] == a[j]+a[j-1]+1){
					m++;
					break;
				}
		
		if (m >= k) out.println("YES");
		else out.println("NO");
		out.flush();
	}

}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.BitSet;
import java.util.Scanner;

public class A {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) throws Exception {
		BitSet primes = primes(1001);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int count = 0;
		for (int i = 2; i <= N; ++i) {
			if (!primes.get(i)) continue;
			int res = i - 1;
			boolean found = false;
			for (int j = 2; j <= i / 2; ++j) {
				if (primes.get(j) && primes.nextSetBit(j + 1) == res - j) {
					found = true;
					break;
				}
			}
			if (found) {
				++count;
			}
		}
		System.out.println(count >= K ? "YES" : "NO");
	}

	public static BitSet primes(int max) {
		BitSet primeSet = new BitSet(max + 1);
		if (max < 2) {
			return primeSet;
		}
		int limit = (int) Math.sqrt(max + 1);
		primeSet.set(2);
		for (int i = 3; i < max + 1; i += 2) {
			primeSet.set(i);
		}
		for (int i = 3; i <= limit; i += 2) {
			if (!primeSet.get(i)) {
				continue;
			}
			for (int j = i * i; j < max; j += i) {
				primeSet.clear(j);
			}
		}
		return primeSet;
	}

}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.awt.*;
import java.math.*;
import java.util.regex.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Integer.parseInt;
import static java.util.AbstractMap.*;
import static java.lang.System.*;
import static java.lang.Math.*;
import java.awt.geom.*;
import java.util.*;
import java.text.*;
import java.io.*;

public class A {

	public static void main(String[] args) throws Exception {
		boolean submit = true;		
		Scanner sc = submit ? new Scanner(System.in) : new Scanner(new File("A.in"));
		while(sc.hasNext()) {
			int n = sc.nextInt(), k = sc.nextInt();
			boolean p[] = sieveOfEratosthenes(1001);
			ArrayList<Integer> nolds = new ArrayList<Integer>();
					
			for(int i = 0, prev = 0; i < p.length; i++) {
				if(p[i]) {
					nolds.add(prev+i + 1);
					prev = i;
				}					
			}
			
			//System.out.println(nolds);
			
			int c = 0;
			for(int i : nolds)
				if(i >= 2 && i <= n && p[i])
					c++;
			
			System.out.println(c >= k ? "YES" : "NO");
			
		}
		
		
			
		
		

	}
	
	//prime[i] = true iff i is prime, prime[0] = prime[1] = false and i can be from 0 to n (both inclusive)
    static boolean[] sieveOfEratosthenes(int n) {
        boolean prime[] = new boolean[n+1];
        fill(prime, 2, n, true);
        for(int i = 2; i <= n; i++)
            if(prime[i])
                for(int j = i*i; j <= n; j+=i) //check for i*i overflow
                    prime[j] = false;
        return prime;
    }

}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {

    StreamTokenizer in;
    PrintWriter out;
    public static void main(String[] args) throws IOException
    {
        new Main().run();
    }
    public void run() throws IOException
    {
    //	in =new StreamTokenizer(new BufferedReader(new FileReader("input.txt")));
    //  out = new PrintWriter(new FileWriter("output.txt"));

        in =new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
	   out = new PrintWriter(new OutputStreamWriter(System.out));
             solve();
        out.flush();
        
    }
    public int nextInt() throws IOException
    {
        in.nextToken();
        return (int) in.nval;
    }
    boolean pr(int i)
    {
    	if(i<4) return true;
    	for(int j=2;j<Math.sqrt(i)+1;j++)
    		if(i%j==0)
    			return false;
    	return true;
    }
    public void solve() throws IOException
    {
    	int n=nextInt(),k=nextInt();
    	int prost[]=new int[1000];
    	boolean now[]=new boolean[10000];
    	int a=0;
    	for(int i=2;i!=1000;i++)
    		if(pr(i))
    			prost[a++]=i;
    	for(int i=0;i!=a-1;i++)
    	{
    		if(pr(prost[i]+prost[i+1]+1))
    			now[prost[i]+prost[i+1]+1]=true;
    	}
    	int answ=0;
    	for(int i=0;i!=n+1;i++)
    		if(now[i])
    			answ++;
    	if(answ>=k)
    		out.print("YES");
    	else
    		out.print("NO");
    }

}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.*;

public class A
{
	public static void main(String args[])
	{
		boolean[] b = new boolean[11000];
		Arrays.fill(b, true);
		b[0] = b[1] = false;

		for(int i=2;i < b.length;i++)
		{
			if(!b[i])
				continue;

			for(int j=2;i*j<b.length;j++)
				b[i*j] = false;
		}

		int[] p = new int[11000];
		int pn = 0;

		for(int i=0;i < b.length;i++)
		{
			if(b[i])
				p[pn++] = i;
		}

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int k = scan.nextInt();

		int rtn = 0;

		
		for(int j=0;p[j] <= n;j++)
		{
			//Try to make sum
			for(int h=0;h <= j;h++)
			{
				if(p[h] + p[h+1] + 1 == p[j])
				{
					rtn++;
					break;
				}
			}
		}

		System.out.println(rtn >= k ? "YES" : "NO");
		

	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class A {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        int K = s.nextInt();

        int[] primes = getPrimesFast(N);
        Set<Integer> ints = new HashSet<Integer>();
        for(int i=0;i<primes.length;i++) {
            ints.add(primes[i]);
        }

        for(int i=1;i<primes.length;i++) {
            ints.remove(primes[i] + primes[i-1]+1);
        }

        boolean res = primes.length - ints.size() >= K;
        System.out.print(res?"YES":"NO");
        
    }

    public static int[] getPrimesFast(int n) {
    if (n <= 1) {
      return new int[0];
    }
    boolean[] b = new boolean[n + 1];
    int m = n - 1;
    for (int i = 2; i * i <= n; i++) {
      if (!b[i]) {
        for (int j = i + i; j <= n; j += i) {
          if (!b[j]) {
            m--;
            b[j] = true;
          }
        }
      }
    }
    int[] primes = new int[m];
    int j = 0;
    for (int i = 2; i <= n; i++) {
      if (!b[i]) {
        primes[j++] = i;
      }
    }
    return primes;
  }
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear

import java.util.ArrayList;
import java.util.Scanner;



public class primes {

public static void main(String []  args){

ArrayList<Integer> numb=new ArrayList<Integer>();
Scanner br1 = new Scanner(System.in);
int n=br1.nextInt();
int steps=br1.nextInt();
//if(n>2)numb.add(2);
if(n>=3)numb.add(3);
for(int j=4;j<=n;j++){
if(chekprime(j)==0){

numb.add(j);
//System.out.println(j);
}

}
int counter =0;
for(int give=0;give<numb.size();give++)
{if("YES".equals(sumup(numb, 2, numb.get(give)))){
 counter++;
// System.out.println(numb.get(give)+"ksjdfskldfgaskldfgasklfgaskldfgaklsfgasdklfgaskldfgaskldfgasdklfg");
 }



}

//System.out.println(counter);
if(counter>=steps)System.out.println("YES");
else System.out.println("NO");


}

public static String sumup(ArrayList<Integer> list,int number,int NUM){

String ret="NO";
    ArrayList<Integer> result=new ArrayList<Integer>();

ArrayList<Integer>[] arList=new ArrayList[number];
for(int i=0;i<number;i++){
arList[i]=new ArrayList<Integer>();
arList[i]=(ArrayList<Integer>)list.clone();
for(int k=0;k<i;k++){
arList[i].add(0,arList[i].remove(arList[i].size()-1));
}

}


    int [] temp=new int[list.size()];
    
for(int z=0;z<list.size();z++){
    for(int count=0;count<number;count++){
        
temp[z]+=arList[count].get(z);
//System.out.println(arList[count].get(z));
    }

result.add(temp[z]);

}

if(result.contains(NUM-1))
{    //System.out.println(NUM-1);
ret="YES";
}
return ret;
}



public static int chekprime(int n){
int flag=0;

for(int i=2;i<=Math.sqrt(n)+1;i++)
{
if(n%i==0){
flag=1;
break;
}

} 

return flag;

}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws Exception {
        //System.setIn(new FileInputStream("1"));
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        
        int n = nextInt(), k = nextInt();
        int[] primes = new int[n + 1];
        for (int i = 2; i <= n; i++) {
            if (primes[i] == 0) {
                primes[i] = 1;
                for (int j = i * 2; j <= n; j += i)
                    primes[j] = 2;
            }
        }
        ArrayList<Integer> res = new ArrayList<Integer>();
        HashSet<Integer> p = new HashSet<Integer>(), v = new HashSet<Integer>();
        for (int i = 2; i <= n; i++) {
            if (primes[i] == 1) {
                res.add(i);
                p.add(i);
            }
        }
        int c = 0;
        if (res.size() >= 3) {
            for (int i = 2; i < res.size(); i++) {
                int zz = res.get(i - 2) + res.get(i - 1) + 1;
                if (p.contains(zz))
                    v.add(zz);
            }
            c = v.size();
        }
        if (c >= k) {
            out.println("YES");
        } else {
            out.println("NO");
        }
        in.close();
        out.close();
    }

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer st;

    static String nextString() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    static int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextString());
    }

    static double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextString());
    }
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.util.*;

public class Solution {

	Scanner in;
	PrintWriter out;

	boolean isPrime(int x) {
		for (int i = 2; i * i <= x; ++i) {
			if (x % i == 0) {
				return false;
			}
		}
			return true;
	}

	void solve() throws IOException {
		in = new Scanner(System.in);
		//in = new Scanner(new FileReader("input.txt"));
		out = new PrintWriter(System.out);
		int N = in.nextInt();
		int K = in.nextInt();
		List<Integer> primes = new ArrayList<Integer>();
		for (int i = 2; i <= N; ++i) {
			if (isPrime(i)) {
				primes.add(i);
			}
		}
		int c = 0;
		for (int i = 2; i <= N; ++i) {
			if (!isPrime(i)) continue;
			for (int j = 0; j + 1 < primes.size(); ++j) {
				int p1 = primes.get(j);
				int p2 = primes.get(j + 1);
				if (p1 + p2 + 1 == i) {
					++c;
					//out.println(i);
					break;
				}
			}
		}
		if (c >= K) out.println("YES");
		else out.println("NO");
		out.close();		
	}

	public static void main(String args[]) throws IOException {
		new Solution().solve();
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.util.*;

public class Noldbach
{
	public Scanner in = new Scanner(System.in);
	public PrintStream out = System.out;

	public boolean[] yes;
	public int n, k;
	
	public void main()
	{
		n = in.nextInt();
		k = in.nextInt();
		
		genPrime();
		int i;
		
		yes = new boolean[n+1];
		
		int x;
		for(i=0;i+1<prime.length;++i)
		{
			x = prime[i]+prime[i+1]+1;
			if(x <= n && fac[x] == x) yes[x] = true;
		}
		
		int count = 0;
		for(i=0;i<yes.length;++i) if(yes[i]) ++count;
		
		out.println((count>=k?"YES":"NO"));
	}//end public void main()

	//Generating Primes
	public int N = 100000+100;
	public int[] fac, rest;
	public int[] prime;

	public void genPrime()
	{
		ArrayList<Integer> ap = new ArrayList<Integer>();
		fac = new int[N];
		rest = new int[N];
		
		int x,y;
		for(x=0;x<N;++x)
		{
			fac[x] = x;
			rest[x] = 1;
		}
		
		for(x=2;x<N;++x)
		if(fac[x]==x)
		{
			ap.add(x);
			for(y=x+x;y<N;y+=x)
			if(fac[y]==y)
			{
				fac[y] = x;
				rest[y] = y/x;
			}
		}
		
		prime = new int[ap.size()];
		for(int i=0;i<prime.length;++i) prime[i] = ap.get(i);
	}
	
	
	
	public static void main(String[] args)
	{
		(new Noldbach()).main();
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear

import static java.util.Arrays.*;
import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class A implements Runnable
{
	public static void main(String [] args) throws IOException
	{
		new Thread(null, new A(), "", 1 << 20).start();
	}
	
	String file = "input";
	BufferedReader input;
	PrintWriter out;
	
	public void run() 
	{
		try
		{
			//input = new BufferedReader(new FileReader(file + ".in"));
			input = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new BufferedOutputStream(System.out));
			solve();
			input.close();
			out.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
			System.exit(1);
		}
	}

	void solve() throws IOException
	{
		ArrayList<Integer> p = new ArrayList<Integer>();
		StringTokenizer st = tokens();
		int n = nextInt(st), k = nextInt(st);
		for(int i = 2; i <= n; i++)
			if(prime(i)) p.add(i);
		
		int count = 0;
		for(int x = 2; x <= n; x++)
		{
			if(!prime(x)) continue;
			for(int i = 0; i + 1 < p.size(); i++)
			{
				int p1 = p.get(i);
				int p2 = p.get(i + 1);
				int P = p1 + p2 + 1;
				if(P == x) 
				{
					count++;
					break;
				}
				if(P > x) break;
			}
		}
		System.out.println(count >= k ? "YES" : "NO");
				
	}
	
	boolean prime(int n)
	{
		for(int i = 2; i * i <= n; i++)
			if(n % i == 0) return false;
		return true;
	}

	StringTokenizer tokens() throws IOException
	{
		return new StringTokenizer(input.readLine());
	}
	
	String next(StringTokenizer st)
	{
		return st.nextToken();
	}
	
	int nextInt() throws IOException
	{
		return Integer.parseInt(input.readLine());
	}
	
	int nextInt(StringTokenizer st)
	{
		return Integer.parseInt(st.nextToken());
	}
	
	double nextDouble() throws IOException
	{
		return Double.parseDouble(input.readLine());
	}
	
	double nextDouble(StringTokenizer st)
	{
		return Double.parseDouble(st.nextToken());
	}
	
	void print(Object... o)
	{
		out.println(deepToString(o));
	}
}