codeparrot/codecomplex huggingface dataset:
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.*;
import java.io.*;
import java.math.*;
import javax.script.*;

public class Noldbach {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		boolean[] sieve=new boolean[1001];
		sieve[2]=false;
		ArrayList<Integer> primes=new ArrayList<Integer>();
		for(int x=2;x<1001;x++)
			if(!sieve[x])
			{
				primes.add(x);
				for(int y=x;y<1001;y+=x)
					sieve[y]=true;
			}
		int sum=0;
		for(int x=2;x<=n;x++)
		{
			if(primes.contains(x))
			{
			int need=x-1;
			for(int y=0;y<primes.size()-1;y++)
			{
				if(primes.get(y)+primes.get(y+1)==need)
				{
					sum++;
					break;
				}
			}
			}
			if(sum==k)break;
		}
		if(sum==k)System.out.println("YES");
		else System.out.println("NO");
		
	}
	
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Locale;
import java.util.StringTokenizer;

public class Solution implements Runnable {
	
	public static void main(String[] args) {
		(new Thread(new Solution())).start();
	}
	
	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;
	
	String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	
	void solve() throws Exception {
		boolean[] r = new boolean[1010];
		Arrays.fill(r, true);
		r[0] = r[1] = false;
		for (int i = 2; i < 1010; i++) {
			if (r[i]) {
				for (int j = i + i; j < 1010; j += i) {
					r[j] = false;
				}
			}
		}
		int[] pr = new int[1010];
		int l = 0;
		for (int i = 2; i < 1010; i++) if (r[i]) pr[l++] = i;
		int n = nextInt();
		int k = nextInt();
		int ans = 0;
		int j = 0;
		for (int i = 2; i <= n; i++) {
			if (r[i]) {
			for (; j < l - 1; j++) {
				if (i == pr[j] + pr[j + 1] + 1) {
					ans++;
					break;
				}
				if (i < pr[j] + pr[j + 1] + 1) break;
			}
			}
		}
		if (ans >= k) out.println("YES"); else out.println("NO");
	}
	
	public void run() {
		try {
			Locale.setDefault(Locale.US);
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
		} catch (Exception e) {
			e.printStackTrace();
		}
		out.flush();
	}

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

import java.awt.geom.Point2D;
import java.text.*;
import java.math.*;
import java.util.*;

public class Main implements Runnable {
    
    final String filename="";
    
    public void solve() throws Exception {
        int n = iread(), k = iread();
        boolean[] f = new boolean[10000];
        int prev = -1;
        cycle:for (int i=2; i<=n; i++)
        {
            for (int j=2; j*j<=i; j++)
                if (i%j==0)
                    continue cycle;
            if (prev!=-1)
                f[i+prev+1] = true;
            if (f[i])
                k--;
            prev = i;
        }
        if (k<=0)
            out.write("YES\n");
        else out.write("NO\n");
    }
    
    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new BufferedWriter(new OutputStreamWriter(System.out));
//          in = new BufferedReader(new FileReader(filename+".in"));
//          out = new BufferedWriter(new FileWriter(filename+".out"));
            solve();
            out.flush();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
    
    public int iread() throws Exception {
        return Integer.parseInt(readword());
    }

    public double dread() throws Exception {
        return Double.parseDouble(readword());
    }

    public long lread() throws Exception {
        return Long.parseLong(readword());
    }

    BufferedReader in;

    BufferedWriter out;

    public String readword() throws IOException {
        StringBuilder b = new StringBuilder();
        int c;
        c = in.read();
        while (c >= 0 && c <= ' ')
            c = in.read();
        if (c < 0)
            return "";
        while (c > ' ') {
            b.append((char) c);
            c = in.read();
        }
        return b.toString();
    }
    public static void main(String[] args) {
        try{
            Locale.setDefault(Locale.US);
        } catch (Exception e)
        {
            
        }
        new Thread(new Main()).start();
        //new Thread(null, new Main(), "1", 1<<25).start();
    }
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.*;

public class Main
{
	static int MAX = 1000;
	
	static BitSet P = new BitSet(MAX + 1);
		
	public static boolean Noldbach(int n)
	{
		n--;
		
		int j;
		
		for(int i=2; i<=n; i++)
		{
			if(!P.get(i))
			{
				j = i + 1;
				
				while(P.get(j))
					j++;
				
				if(i+j == n)
				{
					if(!P.get(i+j+1))
					{
						//System.out.println((n+1)+" = "+i+" + "+(n-i)+" + 1");
					
						return true;
					}
				}
			}
		}
		
		return false;
	}
	
	public static void main(String[] args)
	{
		Scanner lee = new Scanner(System.in);	

		for(int i=2; i*i<=MAX; i++)
		{
		    if(!P.get(i))
		    {
		    	for(int j=i+i; j<=MAX; j+=i)
		    		P.set(j);
		    }
		}
		
		int n, k, c;
		
		n = lee.nextInt();
		k = lee.nextInt();
		
		c = 0;
		
		for(int i=2; i<=n; i++)
		{
			if(Noldbach(i))
				c++;
			
			if(c == k)
				break;
		}
		
		if(c == k)
			System.out.println("YES");
		else
			System.out.println("NO");
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Thread() {
			public void run() {
				try {
					new Main().run();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}.start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		
		boolean[] pr = new boolean[1001];
		for (int i = 2; i <= 1000; i++)
			if (!pr[i]) {
				int l = 2 * i;
				while (l <= 1000) {
					pr[l] = true;
					l += i;
				}
			}
		Set<Integer> set = new HashSet<Integer>();
		for (int i = 2; i < 1000; i++) {
			for (int j = i + 1; j <= 1000; j++) {
				if (!pr[j]) {
					set.add(j + i + 1);
					i = j - 1;
					break;
				}
			}
		}
		int n = nextInt();
		int k = nextInt();
		int res = 0;
		for (int i = 2; i <= n; i++) {
			if (set.contains(i) && !pr[i])
				res++;
		}
		if (res >= k)
			out.println("YES");
		else
			out.println("NO");
		
		in.close();
		out.close();
	}

	void chk(boolean b) {
		if (b)
			return;
		System.out.println(new Error().getStackTrace()[1]);
		exit(999);
	}
	void deb(String fmt, Object... args) {
		System.out.printf(Locale.US, fmt + "%n", args);
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;

public class Main {
    StreamTokenizer in;
    //BufferedReader in;
    PrintWriter out;
    public static void main(String[] args) throws IOException {
        new Main().run();
    }
    int ni() throws IOException {
        in.nextToken(); return (int)in.nval;
    }
    void run() throws IOException {
        //in = new StreamTokenizer(new BufferedReader(new FileReader("input.txt")));
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(new OutputStreamWriter(System.out));
        //out = new PrintWriter(new FileWriter("output.txt"));
        int cprime = 0;
        int[] prime = new int[1000];
        for(int i = 2; i < 1001; i++) {
            boolean f = false;
            for(int j = 2; j*j <= i; j++)
                if(i % j == 0) {
                    f = true; break;
                }
            if(!f) prime[cprime++] = i;
        }
        int n = ni(), k = ni();
        int last = 0;
        int count = 0;
        for(int i = 0; i < cprime && prime[i] <= n; i++) {
            for(int j = 0; j < cprime - 1; j++)
                if(prime[j] + prime[j + 1] + 1 == prime[i]) {
                    count++; break;
                }
                else if(prime[j] + prime[j + 1] + 1 > prime[i]) break;
        }
        if(count >= k) out.print("YES");
        else out.print("NO");
        out.flush();
    }
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.Arrays;
import java.util.Scanner;


public class A {

	public static void main(String[] args) {
		new A().run();
	}

	private void run() {
		Scanner sc =new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		sc.close();
		boolean[] isp = new boolean[n + 1];
		Arrays.fill(isp, true);
		isp[1] = false;
		int[] primes = new int[n];
		int pc = 0;
		for (int i = 2; i <= n; i++) {
			if (isp[i]) {
				primes[pc++] = i;
				for (int j = i * i; j <= n; j+= i) {
					isp[j] = false;
				}
			}
		}
		int res = 0;
		for (int i = 0; i < pc; i++) {
			for (int j = 1; j < i; j++)				
					if (primes[i] == primes[j] + primes[j - 1] + 1)
						res++;
		}
		System.out.println(res >= k ? "YES" : "NO");
	}

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

/**
 * Created by HREN_VAM.
 */

public class A implements Runnable{

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st;
    public static final String filename = "";

    public void solve() throws IOException{

        int n = nextInt();

        int[] a = new int[n + 1];
        ArrayList<Integer> pr = new ArrayList<Integer>();
        
        for(int i = 2;i < n + 1;i ++){
            if(a[i] != 0)continue;
            pr.add(i);
            for(int j = 2 * i;j < n + 1;j += i){
                a[j] = 1;
            }
        }

        int k = nextInt();
        for(int i = 2;i < n + 1;i ++){
            if(a[i] != 0)continue;
            for(int j = 1;j < pr.size();j ++){
                if(i == pr.get(j) + pr.get(j - 1) + 1){
                    k --;
                    break;
                }
            }
        }
        if(k > 0){
            out.println("NO");
            return;
        }
        out.println("YES");
    }

    public void run(){
        try{
            Locale.setDefault(Locale.US);
            in = new BufferedReader(new InputStreamReader(System.in));
            //in = new BufferedReader(new FileReader(filename + ".in"));
            out = new PrintWriter(System.out);
            //out = new PrintWriter(new FileWriter(filename + ".out"));
            st = new StringTokenizer("");
            solve();
            out.close();
        } catch(IOException e){
            throw new RuntimeException(e);
        }
    }

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

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

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

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

public class Main {
	static Scanner in;
	static PrintWriter out;
//	static final String PROBLEM = "";

	public static void main(String[] args) throws Exception {
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);
		
		int n = in.nextInt();
		int k = in.nextInt();

		boolean[] p = new boolean[n + 5];
		int[] pp = new int[n + 5];
		int ind = 0;
		Arrays.fill(p, true);
		p[0] = false;
		p[1] = false;
		for (int i = 2; i < n + 5; i++)
			if (p[i]) {
				pp[ind++] = i;
				for (int j = 2*i; j < n + 5; j += i) p[j] = false;
			}
//	    for (int i = 0; i < 30; i++) if (p[i]) out.println(i);
		
		boolean[] b = new boolean[n + 1];
		for (int i = 0; i < ind - 1; i++)
			if (pp[i] + pp[i + 1] + 1 <= n && p[pp[i] + pp[i + 1] + 1]) b[pp[i] + pp[i + 1] + 1] = true;
		
		int kol = 0;
		for (int i = 2; i <= n; i++)	
			if (b[i]) kol++;

		if (kol >= k) out.println("YES");
		else out.println("NO");

		out.close();
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.util.*;
public class Answer17A{
    public static void main(String[] args){
	try{
	    BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
	    String[] tmp=reader.readLine().split(" ");
	    int n=Integer.parseInt(tmp[0]);
	    int k=Integer.parseInt(tmp[1]);
	    boolean[] m=getPrime(n);
	    ArrayList<Integer> prime=new ArrayList<Integer>();
	    for(int i=0;i<m.length;i++){
		if(m[i])prime.add(i);
	    }
	    int sum=0;
	    for(int i=2;i<=n;i++){
		if(m[i]){
		    for(int j=0;j<prime.size()-1;j++){
			if(i==prime.get(j)+prime.get(j+1)+1){
			    sum++;
			    break;
			}
		    }
		}
	    }
	    if(sum>=k){
		System.out.println("YES");
	    }else{
		System.out.println("NO");
	    }
	}catch(IOException e){
	    e.printStackTrace();
	}
    }
    public static boolean[] getPrime(int N){
	boolean[] memo=new boolean[N+1];
	Arrays.fill(memo,true);
	memo[0]=false;
	memo[1]=false;
	for(int i=2;i*i<=N;i++){
	    if(memo[i]){
		for(int j=i*i;j<=N;j+=i){
		    memo[j]=false;
		}
	    }
	}
	return memo;
    }

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

public class A{

    void exe(){
        LinkedList<Integer> list=new LinkedList<Integer>();
        for(int i=2;i<=1000;i++)
            if(isPrime(i))
                list.add(i);
        Object[] primes=list.toArray();
        
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int cnt=0;
        for(int c=2;c<=n;c++){
            if(!isPrime(c))
                continue;
            for(int i=0;i<primes.length-1;i++){
                int p1=(Integer)primes[i];
                int p2=(Integer)primes[i+1];
                if(c==1+p1+p2){
//                  System.out.println("c="+c+", i="+p1+", j="+p2);
                    cnt++;
                }
            }
        }
        if(cnt>=k){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }

    boolean isPrime(int n){
        if(n<=1)return false;
        if(n==2)return true;
        if(n%2==0)return false;
        int m=(int)Math.sqrt(n)+1;
        for(int i=3;i<=m;i+=2)
            if(n%i==0)
                return false;
        return true;
    }
    
    public static void main(String[] args){
        Locale.setDefault(Locale.US);
        new A().exe();
    }
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * Problem solution template.
 * @author Andrew Porokhin, andrew.porokhin@gmail.com
 */
public class Problem17A implements Runnable {
    void solve() throws NumberFormatException, IOException {
        
        
        
        int n = nextInt();
        int k = nextInt();

        ArrayList<Integer> primes = new ArrayList<Integer>(n + 1); 
        boolean[] simplePrime = new boolean[n + 1];
        Arrays.fill(simplePrime, 0, simplePrime.length, true);
        simplePrime[0] = simplePrime[1] = false;
        
        for (int i = 2; i <= n; i++) {
            if (simplePrime[i]) {
                for (int j = i + i; j <= n; j += i) {
                    simplePrime[j] = false;
                }
                
                primes.add(i);
            }
        }
        
        
        int actualK = 0;
        for (int i = 1; i < primes.size(); i++) {
            int val = primes.get(i - 1) + primes.get(i) + 1;
            if (val <= n) {
                if (simplePrime[val]) {
                    // System.out.printf("%d + %d + 1 = %d%n", primes.get(i - 1), primes.get(i), val);
                    actualK++;
                }
            } else {
                break;
            }
        }
        // System.out.printf("req: %d actual: %d%n", k, actualK);
        System.out.println((k <= actualK ? "YES" : "NO"));
    }

    
    StringTokenizer st;
    BufferedReader in;
    PrintWriter out;
    
    public static void main(String[] args) {
        new Problem17A().run();
    }

    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            out.flush();
            out.close();
        }
    }

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

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

    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

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

public class Solution {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st;

    int n, k;

    boolean[] prime;
    int[] primes;

    void sieve() {
        prime = new boolean[n + 1];
        Arrays.fill(prime, true);
        prime[0] = prime[1] = false;
        int cnt = 0;
        for (int i = 2; i <= n; ++i)
            if (prime[i]) {
                ++cnt;
                for (int j = i + i; j <= n; j += i)
                    prime[j] = false;
            }
        primes = new int[cnt];
        cnt = 0;
        for (int i = 0; i <= n; ++i)
            if (prime[i])
                primes[cnt++] = i;
    }

    void solve() throws IOException {
        n = ni();
        k = ni();
        sieve();
        int cnt = 0;
        for (int i = 2; i <= n; ++i) {
            if (!prime[i])
                continue;
            boolean ok = false;
            for (int j = 0; j < primes.length - 1; ++j)
                if (primes[j] + primes[j + 1] + 1 == i) {
                    ok = true;
                    break;
                }
            if (ok)
                ++cnt;
        }
        if (cnt >= k)
            out.println("YES");

        else
            out.println("NO");
    }

    public Solution() 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 Solution();
    }
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.util.*;

public class ProblemaNoldbaha implements Runnable{
	public static void main(String[] args) throws IOException {
		new Thread(new ProblemaNoldbaha()).start();
	}
	
	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;
	
	public String nextToken() throws IOException{
		while (in == null || !in.hasMoreTokens()){
			in = new StringTokenizer(br.readLine());
		}
		
		return in.nextToken();
	}
	
	public int nextInt() throws IOException{
		return Integer.parseInt(nextToken());
	}
	
	public double nextDouble() throws IOException{
		return Double.parseDouble(nextToken());
	}
	
	public void solve() throws IOException{
		int n = nextInt();
		int k = nextInt();
		
		int[] prime = new int[1000];
		
		int l = 0;
		
		for (int i = 2; i <= n; i++) {
			boolean f = false;
			for (int j = 2; j < i; j++) {
				if (i % j == 0){
					f = true;
					break;
				}
			}
			
			if (!f){
				prime[l] = i;
				l++;
			}
		}
		
		int count = 0;
		for (int i = 2; i < l; i++) {
			boolean f = false;
			for (int j = 0; j < l - 1; j++) {
				if (prime[j] + prime[j + 1] + 1 == prime[i]){
					f = true;
					break;
				}
			}
			
			if (f) count++;
		}
		
		if (count >= k){
			out.println("YES");
		}
		else{
			out.println("NO");
		}
	}
	
	public void run(){
		try{
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			
			solve();
			
			out.close();
		}
		catch(IOException e){
			e.printStackTrace();
			System.exit(1);
		}
	}
}