Language: C++

//--- pB ---//
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
	public static void main (String[] args) throws java.lang.Exception {
		new Solution();
	}
}
class Solution {
	Reader reader;
	public Solution () {
		reader = new Reader();
		while (reader.hasNext()) {
			run_case();
		}
	}

	private void run_case() {
		int n = reader.ni();
		int m = reader.ni();
		int[] arr = new int[n];
		for (int i=0; i<n; i++) arr[i] = reader.ni();

		int sum = 0;
		for (int u : arr) sum += u;

		double th = (1.0 / (4.0 * m)) * sum;

		int cnt = 0;
		for (int u : arr) {
			if (u >= th) {
				cnt ++;
			}
		}

		if (cnt >= m) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

		return;
	}
}


class Reader {
	BufferedReader br;
	StringTokenizer st;
	public Reader(){
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public String next() {
		if (st.hasMoreTokens()) return st.nextToken();
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return st.nextToken();
	}
	public boolean hasNext() {
		try {
			if (!st.hasMoreTokens() && !br.ready()) return false;
			else return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	public int ni() {return Integer.parseInt(this.next());}
	public String ns() {return this.next();}
}


Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.lang.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
a.cc:11:9: error: 'Reader' does not name a type
   11 |         Reader reader;
      |         ^~~~~~
a.cc:12:15: error: expected ':' before 'Solution'
   12 |         public Solution () {
      |               ^~~~~~~~~
      |               :
a.cc:19:16: error: expected ':' before 'void'
   19 |         private void run_case() {
      |                ^~~~~
      |                :
a.cc:45:2: error: expected ';' after class definition
   45 | }
      |  ^
      |  ;
a.cc: In constructor 'Solution::Solution()':
a.cc:13:17: error: 'reader' was not declared in this scope
   13 |                 reader = new Reader();
      |                 ^~~~~~
a.cc:13:30: error: expected type-specifier before 'Reader'
   13 |                 reader = new Reader();
      |                              ^~~~~~
a.cc: In member function 'void Solution::run_case()':
a.cc:20:25: error: 'reader' was not declared in this scope
   20 |                 int n = reader.ni();
      |                         ^~~~~~
a.cc:22:20: error: structured binding declaration cannot have type 'int'
   22 |                 int[] arr = new int[n];
      |                    ^~
a.cc:22:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:22:20: error: empty structured binding declaration
a.cc:22:23: error: expected initializer before 'arr'
   22 |                 int[] arr = new int[n];
      |                       ^~~
a.cc:23:41: error: 'arr' was not declared in this scope
   23 |                 for (int i=0; i<n; i++) arr[i] = reader.ni();
      |                                         ^~~
a.cc:26:30: error: 'arr' was not declared in this scope
   26 |                 for (int u : arr) sum += u;
      |                              ^~~
a.cc:31:30: error: 'arr' was not declared in this scope
   31 |                 for (int u : arr) {
      |                              ^~~
a.cc:38:25: error: 'System' was not declared in this scope
   38 |                         System.out.println("Yes");
      |                         ^~~~~~
a.cc:40:25: error: 'System' was not declared in this scope
   40 |                         System.out.println("No");
      |                         ^~~~~~
a.cc: At global scope:
a.cc:49:9: error: 'BufferedReader' does not name a type
   49 |         BufferedReader br;
      |         ^~~~~~~~~~~~~~
a.cc:50:9: error: 'StringTokenizer' does not name a type
   50 |         StringTokenizer st;
      |         ^~~~~~~~~~~~~~~
a.cc:51:15: error: expected ':' before 'Reader'
   51 |         public Reader(){
      |               ^~~~~~~
      |               :
a.cc:59:15: error: expected ':' before 'String'
   59 |         public String next() {
      |               ^~~~~~~
      |               :
a.cc:59:16: error: 'String' does not name a type
   59 |         public String next() {
      |                ^~~~~~
a.cc:68:15: error: expected ':' before 'boolean'
   68 |         public boolean hasNext() {
      |               ^~~~~~~~
      |               :
a.cc:68:16: error: 'boolean' does not name a type; did you mean 'bool'?
   68 |         public boolean hasNext() {
      |                ^~~~~~~
      |                bool
a.cc:77:15: error: expected ':' before 'int'
   77 |         public int ni() {return Integer.parseInt(this.next());}
      |               ^~~~
      |               :
a.cc:78:15: error: expected ':' before 'String'
   78 |         public String ns() {return this.next();}
      |               ^~~~~~~
      |               :
a.cc:78:16: error: 'String' does not name a type
   78 |         public String ns() {return this.next();}
      |                ^~~~~~
a.cc:79:2: error: expected ';' after class definition
   79 | }
      |  ^
      |  ;
a.cc: In constructor 'Reader::Reader()':
a.cc:53:25: error: 'br' was not declared in this scope
   53 |                         br = new BufferedReader(new InputStreamReader(System.in));
      |                         ^~
a.cc:53:34: error: expected type-specifier before 'BufferedReader'
   53 |                         br = new BufferedReader(new InputStreamReader(System.in));
      |                                  ^~~~~~~~~~~~~~
a.cc:54:25: error: 'st' was not declared in this scope; did you mean 'std'?
   54 |                         st = new StringTokenizer(br.readLine());
      |                         ^~
      |                         std
a.cc:54:34: error: expected type-specifier before 'StringTokenizer'
   54 |                         st = new StringTokenizer(br.readLine());
      |                                  ^~~~~~~~~~~~~~~
a.cc:55:26: error: 'Exception' does not name a type
   55 |                 } catch (Exception e) {
      |                          ^~~~~~~~~
a.cc:56:25: error: 'e' was not declared in this scope
   56 |                         e.printStackTrace();
      |                         ^
a.cc: In member function 'int Reader::ni()':
a.cc:77:33: error: 'Integer' was not declared in this scope
   77 |         public int ni() {return Integer.parseInt(this.next());}
      |                                 ^~~~~~~
a.cc:77:55: error: request for member 'next' in '(Reader*)this', which is of pointer type 'Reader*' (maybe you meant to use '->' ?)
   77 |         public int ni() {return Integer.parseInt(this.next());}
      |                                                       ^~~~