import java.util.*; public class No1015 { public static void main(String[] args) { // 標準入力から読み込む際に、Scannerオブジェクトを使う。 Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int sen = sc.nextInt(); int gosen = sc.nextInt(); int man = sc.nextInt(); List en = new ArrayList<>(); while (sc.hasNext()) { en.add(sc.nextInt()); } Collections.sort(en, Collections.reverseOrder()); while (en.size() >= 0) { int shop = en.get(0); if (man > 0) { shop -= 10000; man--; } else if (gosen > 0) { shop -= 5000; gosen--; } else { sen -= (shop+1)/1000 + 1; if (sen < 0) { System.out.println("No"); return; } shop = -1; } if (shop>=0) { en.set(0, shop); Collections.sort(en, Collections.reverseOrder()); } else { en.remove(0); } } System.out.println("Yes"); } }