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

public class A {
    private static Scanner sc = new Scanner(new InputStreamReader(System.in));
    public static void main (String[] args) throws IOException {
        BitSet b = new BitSet(1001);
        BitSet p = primes(1001);
        for (int i = 0; i < ps.length - 1; i++) {
            b.set(ps[i] + ps[i+1] + 1);
        }
        int n = sc.nextInt(), k = sc.nextInt();
        for (int x = 0; x <= n; x++) {
            if (b.get(x) && p.get(x)) k--;
        }
        System.out.println(k > 0 ? "NO" : "YES");
    }

    private static BitSet primes (int n) {
        BitSet b = new BitSet(n+1);
        b.set(2, n);
        for (int p = 2; p <= n; p++) {
            if (b.get(p)) {
                for (int x = p * 2; x <= n; x += p) {
                    b.clear(x);
                }
            }
        }
        return b;
    }
        private static int [] ps = new int[] {2,
                3,
                5,
                7,
                11,
                13,
                17,
                19,
                23,
                29,
                31,
                37,
                41,
                43,
                47,
                53,
                59,
                61,
                67,
                71,
                73,
                79,
                83,
                89,
                97,
                101,
                103,
                107,
                109,
                113,
                127,
                131,
                137,
                139,
                149,
                151,
                157,
                163,
                167,
                173,
                179,
                181,
                191,
                193,
                197,
                199,
                211,
                223,
                227,
                229,
                233,
                239,
                241,
                251,
                257,
                263,
                269,
                271,
                277,
                281,
                283,
                293,
                307,
                311,
                313,
                317,
                331,
                337,
                347,
                349,
                353,
                359,
                367,
                373,
                379,
                383,
                389,
                397,
                401,
                409,
                419,
                421,
                431,
                433,
                439,
                443,
                449,
                457,
                461,
                463,
                467,
                479,
                487,
                491,
                499};
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

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 Main().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	boolean[] erat = new boolean [1000 + 1];
	int[] primes = new int [1000 + 1];
	int pNum = 0;
	
	void run() throws IOException {
		
		for (int i = 2; i <= 1000; i++) {
			if (!erat[i]) {
				primes[pNum++] = i;
				for (int j = i * i; j <= 1000; j += i)
					erat[j] = true;
			}
		}
		
		int[] cnt = new int [1000 + 1];
		cnt[2] = 0;
		
		for (int i = 3; i <= 1000; i++) {
			cnt[i] = cnt[i - 1];
			if (!erat[i]) {
				int r = i - 1;
				for (int j = 1; j < pNum; j++) {
					if (r == primes[j - 1] + primes[j]) {
						cnt[i]++;
						break;
					}
				}
			}
		}

		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		
		int n = nextInt();
		int k = nextInt();
		
		out.println(k <= cnt[n] ? "YES" : "NO");
		
		out.close();
	}
	
	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.util.Arrays;
import java.util.StringTokenizer;

public class Naldbah implements Runnable {

    boolean isLocalMode = false;

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

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(getReader());
            tokenizer = null;
            writer = new PrintWriter(System.out);
            //do job
            doJob();

            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    private void doJob() throws IOException {
        int n = nextInt();
        int k = nextInt();
        boolean[] primes = sieve(n + 1);

        for(int i=n;i>=2;i--){
            if(primes[i]){
                int solve = i-1;
                int sn=getNextD(primes,solve);
                int en = getNextD(primes,n);
                while(en!=-1&&sn+en>=solve){
                    if((sn+en)==solve)k--;
                    sn=en;
                    en=getNextD(primes,en);
                }
            }
        }
        writer.write(k<=0?"YES":"NO");
    }

    private int getNextD(boolean[] primes, int i) {
        for(int p = i-1;p>=2;p--){
            if(primes[p])return p;
        }
        return -1;
    }

    public boolean[] sieve(int n)
    {
       boolean[] prime=new boolean[n+1];
       Arrays.fill(prime,true);
       prime[0]=false;
       prime[1]=false;
       int m= (int) Math.sqrt(n);

       for (int i=2; i<=m; i++)
          if (prime[i])
             for (int k=i*i; k<=n; k+=i)
                prime[k]=false;

       return prime;
    }



    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 nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    public Reader getReader() throws FileNotFoundException {
        if (isLocalMode) {
            return new FileReader("input.txt");
        } else {
            return new InputStreamReader(System.in);
        }
    }
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.util.*;

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

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		boolean eof;
		String buf;

		public FastScanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
			nextToken();
		}

		public FastScanner(InputStream stream) {
			br = new BufferedReader(new InputStreamReader(stream));
			nextToken();
		}

		String nextToken() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					eof = true;
					break;
				}
			}
			String ret = buf;
			buf = eof ? "-1" : st.nextToken();
			return ret;
		}

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

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

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

		void close() {
			try {
				br.close();
			} catch (Exception e) {

			}
		}

		boolean isEOF() {
			return eof;
		}
	}

	FastScanner sc;
	PrintWriter out;

	public void run() {
		Locale.setDefault(Locale.US);
		try {
			sc = new FastScanner(System.in);
			out = new PrintWriter(System.out);
			solve();
			sc.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	int nextInt() {
		return sc.nextInt();
	}

	String nextToken() {
		return sc.nextToken();
	}

	long nextLong() {
		return sc.nextLong();
	}

	double nextDouble() {
		return sc.nextDouble();
	}

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

	void solve() {
		int n = nextInt();
		int k = nextInt();
		ArrayList<Integer> primes = new ArrayList<Integer>();
		for (int i = 2; i <= n; i++) {
			if (isPrime(i)) {
				primes.add(i);
			}
		}
		int ans = 0;
		for (int i = 0; i < primes.size(); i++) {
			for (int j = 0; j < i - 1; j++) {
				if (primes.get(j) + primes.get(j + 1) + 1 == primes.get(i)
						.intValue()) {
					ans++;
					break;
				}
			}
		}
		if (ans >= k) {
			out.println("YES");

		} else {
			out.println("NO");
		}
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.*;
import java.io.*;
public class Main
{
	public static void main(String args[]) throws IOException
	{
		Scanner sc = new Scanner(System.in);
                int n = sc.nextInt(), k = sc.nextInt(), kol = 0, prev;
                boolean ok;
                ArrayList<Integer> al = new ArrayList<Integer>();
                al.add(2);
                prev = 2;
                for(int i=3;i<=n;i+=2)
                {
                	ok = true;
                	for(Integer x: al) 
                	if (i%x == 0)
                	{
                		ok = false;
                		break;
                	}
                	if (ok) 
                	{
                		for(Integer x: al)
                		if (ok) 
                		{
                			prev = x; 
                			ok = false;
                		} else
                		{
	                		if (x + prev + 1 == i) 
	                		{
	                			kol++;
	                			break;
	                		}
	                		if (x + prev + 1 > i) break;
	                		prev = x;
                		}
                		al.add(i);
                	}
                }
                if (kol >= k) System.out.print("YES"); else System.out.print("NO");
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class A {
	public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt()-1;
		PrimeGen p = new PrimeGen(n);
		List<Integer> prims = new ArrayList<Integer>();
		for(int i = 2; i <= n; i++){
			if(p.isPrime(i)>0){
				prims.add(i);
			}
		}
		int sum = 0;
		for(int i = 0; i < prims.size() - 1; i++){
			int c = prims.get(i) + prims.get(i+1) + 1;
			if(c <= n && p.isPrime(c)>0){
				sum ++;
			}
		}
		System.out.println(sum>=k?"YES":"NO");
	}

	static int sum(List<Integer> is) {
		int c = 0;
		for (int i : is)
			c += i;
		return c;
	}
	
	static class PrimeGen {
		public PrimeGen(int m) {
			m = (int) Math.sqrt(m);
			double max = 0;
			int r = 1;
			for (int i = 0; i < 4;) {
				max += r * m / Math.pow(Math.log1p(m), ++i);
				r *= i;
			}
			p = new int[(int) max];
			for (int i = 0, e = 2; i < p.length; i++) {
				for (; isPrime(e) < 1; e++)
					;
				p[i] = e++;
			}
			this.m = p[p.length - 1];
			this.m = this.m * this.m;
		}

		int isPrime(int n) {
			for (int e : p)
				if (e < 1)
					break;
				else if (n != e && n % e < 1)
					return 0;
			return 1;
		}

		int max() {
			return m;
		}

		int[] p;
		int m;
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
import java.math.*;

public class Main implements Runnable {
	BufferedReader in;  
	StringTokenizer st = new StringTokenizer("");
	
	public static void main(String [] args) throws Exception {
		new Thread(new Main()).start();
	}

	 void printExit(String s) {
		System.out.println(s);
		System.exit(0);
	}

	public void run() {
		try {
			Locale.setDefault(Locale.US);
			in = new BufferedReader(new InputStreamReader(System.in));
			int n = nextInt();
			int k = nextInt();
			int max = 5000;
			ArrayList <Integer> primes = new ArrayList <Integer> ();
			boolean [] p = new boolean [max];
			Arrays.fill(p, true);
			for (int i = 2; i < max; i++) {
				if (p[i]) {
					primes.add(i);
					for (int j = i * i; j < max; j += i)
						p[j] = false;
				}		
				
			}

			HashSet <Integer> good = new HashSet <Integer> ();
			for (int i = 0; i < primes.size() - 1; i++) {
				good.add(primes.get(i) + primes.get(i + 1) + 1);
			}

			int have = 0, pos = 0;
			while (true) {
				int i = primes.get(pos);     
				if (i > n) break;
				if (good.contains(i)) have++;
				pos++;
			}
			System.out.println(have >= k ? "YES" : "NO");
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

	 boolean seekForToken() {
 		try {
			while (!st.hasMoreTokens()) {
				String s = in.readLine();
				if (s == null) {
				 	return false;
				}
			 	st = new StringTokenizer(s);
			}
			return true;
		}
		catch (IOException e) {
		 	e.printStackTrace();
		 	return false;
		}
 	}

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

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

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

 	 BigInteger nextBigInteger() {
 	 	return new BigInteger(nextToken());
 	}

 	 String nextToken() {
 	 	seekForToken();
 	 	return st.nextToken();
 	}

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

public class A {

	private static int[] prime = new int[] {
		    2,     3,     5,     7,    11,    13,    17,    19,    23,    29,    31,    37,    41,    43,
		   47,    53,    59,    61,    67,    71,    73,    79,    83,    89,    97,   101,   103,   107,
		  109,   113,   127,   131,   137,   139,   149,   151,   157,   163,   167,   173,   179,   181,
		  191,   193,   197,   199,   211,   223,   227,   229,   233,   239,   241,   251,   257,   263,
		  269,   271,   277,   281,   283,   293,   307,   311,   313,   317,   331,   337,   347,   349,
		  353,   359,   367,   373,   379,   383,   389,   397,   401,   409,   419,   421,   431,   433,
		  439,   443,   449,   457,   461,   463,   467,   479,   487,   491,   499,   503,   509,   521,
		  523,   541,   547,   557,   563,   569,   571,   577,   587,   593,   599,   601,   607,   613,
		  617,   619,   631,   641,   643,   647,   653,   659,   661,   673,   677,   683,   691,   701,
		  709,   719,   727,   733,   739,   743,   751,   757,   761,   769,   773,   787,   797,   809,
		  811,   821,   823,   827,   829,   839,   853,   857,   859,   863,   877,   881,   883,   887,
		  907,   911,   919,   929,   937,   941,   947,   953,   967,   971,   977,   983,   991,   997				
	};
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		for (int i=0;i<prime.length-1;i++) {
			if ((prime[i]+prime[i+1]+1) > n || k == 0)
				break;
			if (isPrime(prime[i]+prime[i+1]+1))
				k--;
		}
		
		if (k == 0)
			outnl("YES");
		else
			outnl("NO");
	}
	
	public static boolean isPrime(int x) {
		int i=0;
		while (i<prime.length)
			if (prime[i++] == x)
				return true;
		return false;
	}
	
	private static void debug(Object... os) { System.out.println(deepToString(os)); }
	private static void outnl(String out) { System.out.println(out); } 

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

 
public class Main  implements Runnable {
//public static final String FileName = "test";
StreamTokenizer ST;      
PrintWriter out;      
BufferedReader br;   
Scanner in;
static final int inf = 1000000000;
 
int nextInt() throws IOException{      
    ST.nextToken();      
    return (int)ST.nval;      
}
long nextLong() throws IOException{      
    ST.nextToken();      
    return (long)ST.nval;      
}      
String next() throws IOException{      
    ST.nextToken();      
    return ST.sval;      
}      
double nextD() throws IOException{      
    ST.nextToken();      
    return ST.nval;      
}      
public static void main(String[] args) throws IOException {       
   new Thread(new Main()).start();
//  new Main().run();
}
 
public void run()  {      
    try {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));      
        //br = new BufferedReader(new FileReader(new File(FileName+".in")));
        //out = new PrintWriter(new BufferedWriter(new FileWriter(FileName+".out")));
        in = new Scanner(br);
        ST = new StreamTokenizer(br);      
        solve();      
        out.close();
        //in.close();
        br.close();   
    }         
    catch (IOException e) {       
        e.printStackTrace();
        throw new IllegalStateException(e);  
    }      
}


public void solve() throws IOException {
    int n = nextInt();
    int K = nextInt();
    boolean[] f = new boolean[n+1];
    Arrays.fill(f, true);
    Vector<Integer> P = new Vector<Integer>();
    for (int i=2; i<=n; i++)
        if (f[i]) {
            for (int j=2*i; j<=n; j+=i) 
                f[j] = false;
            P.add(i);
        }
    for (int i=0; i<P.size()-1; i++) {
        int x = P.elementAt(i)+P.elementAt(i+1)+1;
        if (x<=n && f[x]) K--;
    }
    if (K<=0) out.println("YES"); else out.println("NO");
    //for (int x:P) out.print(x+" ");
    
}
  
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class A {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s = new String(in.readLine());
        String[] t=s.split(" ");
        int n = Integer.parseInt(t[0]);
        int k = Integer.parseInt(t[1]);
        boolean[] prime=new boolean[n+1];
        for (int i=2;i<Math.sqrt(n);i++) {
        	for (int j=i+i;j<=n;j=j+i) {
        		prime[j]=true;
        	}
        }
        int size=0;
        for (int i=2;i<=n;i++) {
        	if (!prime[i]) {
        		size++;
        	}
        }
        int[] pn=new int[size];
        int index=0;
        for (int i=2;i<=n;i++) {
        	if (!prime[i]) {
        		pn[index]=i;
        		index++;
        	}        	
        }
        for (int i=2;i<size;i++) {
        	for (int j=0;j<i;j++) {
        		if (pn[i]==pn[j]+pn[j+1]+1) {
//       			System.out.println(pn[i]+"="+pn[j]+"+"+pn[j+1]+"+1");
        			k--;
        		}
        	}
        }
        if (k<=0) {
        	System.out.println("YES");
        } else {
        	System.out.println("NO");
        }
	}

}
// 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.io.StreamTokenizer;
import java.util.Arrays;
import java.util.HashSet;

public class E17 {

	static StreamTokenizer in;
	static PrintWriter out;
	
	static int nextInt() throws IOException {
		in.nextToken();
		return (int)in.nval;
	}
	
	static String nextString() throws IOException {
		in.nextToken();
		return in.sval;
	}

	public static void main(String[] args) throws IOException {
		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
		out = new PrintWriter(System.out);
		
		int n = nextInt(), k = nextInt();
		int MAX = n, nprimes = 0;
		int[] primes = new int[MAX];
		boolean[] isPrime = new boolean[MAX+1];
		Arrays.fill(isPrime, true);
		isPrime[0] = false;
		isPrime[1] = false;
		for (int i = 2; i <= MAX; i++) if (isPrime[i]) {
			primes[nprimes++] = i;
			for (int j = i + i; j <= MAX; j += i) isPrime[j] = false;
		}
		primes[nprimes] = Integer.MAX_VALUE;
		
		HashSet<Integer> h = new HashSet<Integer>();
		for (int i = 1; i < nprimes; i++) {
			int x = primes[i-1] + primes[i] + 1;
			if (x > n) break;
			if (isPrime[x]) h.add(x);
		}
		
		out.println(h.size() >= k ? "YES" : "NO");
		
		out.flush();
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.io.*;
import java.util.*;

public class Solution {
	
	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	void solve() throws IOException {
		int n = nextInt();
		int k = nextInt();
		ArrayList<Integer> ps = new ArrayList<Integer>();
		boolean[] prime = new boolean[n + 1];
		Arrays.fill(prime, true);
		prime[0] = prime[1] = false;
		for (int i = 2; i <= n; ++i) {
			if (prime[i]) {
				ps.add(i);
				for (int j = 2 * i; j <= n; j += i) {
					prime[j] = false;
				}
			}
		}
		for (int i = 0; i < ps.size() - 1; ++i) {
			int t = ps.get(i) + ps.get(i + 1) + 1;
			if (t <= n && prime[t]) {
				--k;
			}
		}
//		System.out.println(k);
		out.println(k <= 0 ? "YES" : "NO");
	}

	Solution() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		
		eat("");
		
		solve();
		
		in.close();
		out.close();
	}
	
	private void eat(String str) {
		st = new StringTokenizer(str);
	}
	
	String next() throws IOException {
		while (!st.hasMoreTokens()) {
			String line = in.readLine();
			if (line == null) {
				return null;
			}
			eat(line);
		}
		return st.nextToken();
	}
	
	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}
	
	long nextLong() throws IOException {
		return Long.parseLong(next());
	}
	
	double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public static void main(String[] args) throws IOException {
		new Solution();
	}
}
// Problem: 17_A. Noldbach problem
// Time complexity: linear
import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;
public class Main
{
    Scanner cin;
    int []prime;
    int top;
    void work()
    {
        cin=new Scanner(System.in); 
        int n=cin.nextInt();
        int k=cin.nextInt();
        top=0;
        prime=new int[2000];
        for(int i=2;i<=n;i++)
        {
        	if(isprime(i))
        		prime[top++]=i;
        }
        int cnt=0;
        for(int i=0;i<top;i++)
        {
        	if(cando(prime[i]))
        		cnt++;
        }
        if(cnt>=k) System.out.println("YES");
        else System.out.println("NO");
    }
    boolean cando(int n)
    {
    	for(int i=0;i<top-1;i++)
    	{
    		if(prime[i]+prime[i+1]+1==n) return true;
    	}
    	return false;
    }
    boolean isprime(int n)
    {
    	for(int i=2;i*i<=n;i++)
    		if(n%i==0)return false;
    	return true;
    }
  public static void main(String args[]) throws Exception 
  { 
   
   new Main().work();
  } 


}