jiahuimbzuai/CoQuIR huggingface dataset:
//  [typescript]
var lines: string[] = [];
var reader: any = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on("line", function(line: string) {
  lines.push(line);
});

reader.on("close", function() {
  // A_1,A_2,...
  var numbers: number[] = lines[1].split(" ").map(x => {
    return Number(x);
  });

  var tmpArray: number[] = new Array();
  numbers.forEach((x: number) => {
    tmpArray.push(x);
  });

  var baseSum: number = Math.abs(numbers[0]);
  for (var i: number = 1; i < numbers.length; i++) {
    baseSum = baseSum + Math.abs(numbers[i] - numbers[i - 1]);
  }
  baseSum = baseSum + Math.abs(numbers[numbers.length - 1]);

  for (var i: number = 0; i < numbers.length; i++) {
    if (i == 0) {
      console.log(
        baseSum -
          Math.abs(numbers[0]) -
          Math.abs(numbers[1] - numbers[0]) +
          Math.abs(numbers[1])
      );
    } else if (i == numbers.length - 1) {
      console.log(
        baseSum -
          Math.abs(numbers[numbers.length - 1]) -
          Math.abs(numbers[numbers.length - 1] - numbers[numbers.length - 2]) +
          Math.abs(numbers[numbers.length - 2])
      );
    } else {
      console.log(
        baseSum -
          Math.abs(numbers[i + 1] - numbers[i]) -
          Math.abs(numbers[i] - numbers[i - 1]) +
          Math.abs(numbers[i + 1] - numbers[i - 1])
      );
    }
  }
});
//  [python]
headData = int(input())
digit = sum([int(n) for n in str(headData)])
if headData % digit == 0:
    print("Yes")
else:
    print("No")
//  [python]
N=input()
n=int(N)
a=0
for i in N:
  a+=int(i)
if n%a==0:
  print('Yes')
else:
  print('No')
//  [python]
n = input()
sum = 0
for i in n:
    sum += int(i)
print("Yes"if int(n) % sum == 0 else "No")
//  [python]
import math
import numpy as np

Nstr = input()
N = int(Nstr)
S_N = 0

for n in Nstr:
    S_N += int(n)

if N % S_N == 0:
    print("Yes")
else:
    print("No")
//  [python]
import numpy as np

N = int(input())
S_N = np.array(list(str(N)), dtype = 'int').sum()
if N % S_N == 0:
    print('Yes')
else:
    print('No')
//  [python]
import sys
import numpy as np
N = int(input())
s = str(N)
res = 0
i = 0
while i < np.log10(N):
    res += int(s[i])
    i+= 1
if N % res == 0:
    print('Yes')
else:
    print('No')
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        execute();
    }

    private static void execute() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String number = br.readLine();
        System.out.println(divisibleDigitSum(number));
    }

    private static String divisibleDigitSum(String number) {
        int digitSum = 0;
        for (char digit : number.toCharArray()) {
            digitSum += Integer.parseInt(String.valueOf(digit));
        }
        boolean divisible = Integer.parseInt(number) % digitSum == 0;
        return divisible ? "Yes" : "No";
    }
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		int n = 0;
		
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			n = Integer.parseInt(br.readLine());
		} catch (IOException e) {
			return;
		}
		
		int n2 = n;
		int sn = 0;
		while (n2 > 0) {
			sn += (n2 % 10);
			n2 /= 10;
		}
		
		System.out.println((n % sn == 0) ? "Yes" : "No");
	}
}
//  [java]
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int k = 0;
        char[] c = Integer.toString(n).toCharArray();
        for(char t : c) {
        	k += t - '0';
        }
        if(n % k > 0) {
        	System.out.println("No");
        }else {
        	System.out.println("Yes");
        }
    }
}
//  [java]
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
public class Main{
    public static int sum =0;
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Long a =  sc.nextLong();
        String S = String.valueOf(a);
        Arrays.asList(LIBctoC(S.toCharArray())).forEach(c -> sum +=  c - 48);;
        Long b = sum + 0L;
        System.out.println((a%b==0)?"Yes":"No");
        sc.close();
    }

    public static Character[] LIBctoC(char[] c){
        int size = c.length;
        Character[] C = new Character[size];
        for (int i = 0;i<size;i++){
            C[i] = Character.valueOf(c[i]);
        }
        return C;
    }
}
//  [java]
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        int n;
        try (Scanner cin = new Scanner(System.in)) {
            n = cin.nextInt();
        }
        int sn = Integer.toString(n).chars().map(x -> x - '0').sum();

        System.out.println(n % sn == 0 ? "Yes" : "No");
    }
}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		
		int n = Integer.parseInt(N);

		int result = N.chars().map(s -> Character.getNumericValue(s)).sum();
		
		if (n % result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

		sc.close();
	}

}
//  [cpp]
#include<stdio.h>
int main(){
int s,n,m;
scanf("%d",&n);
m=n;
while(m>9){
s+=m%10;
m=(m-(m%10))/10;
}
s+=m;
if(n%s==0){printf("Yes");}
else{printf("No");}
return 0;
}
//  [cpp]
#include <cstdio>
int M,N,K;
int main(){
	scanf("%d",&M),N=M;
	while (N) K+=N%10,N/=10;
	puts(M%K?"No":"Yes");
	return 0;
}
//  [cpp]
#include <cstdio>
using namespace std;
int m=0;
int f(int n)
{
    int temp=1;
    while(n)
    {
		temp=n%10;
		m+=temp;
        n=n/10;
        
    }
    return temp;
}
int main()
{
    int a,num;
    scanf("%d",&a);
    f(a);
    if(a%m==0)
    {
    	printf("Yes");
    }
    else
    {
    	printf("No");
    }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main() {
int A, B, C = 0 , D, E ;
cin >> A;
B = A / 10;
B++;
E  = A ;

 for (int i = 0; i < B; i++) {
    C+= A % 10;
A/=10;
}

D =E % C;
if ( D == 0 ){
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}

}
//  [cpp]
#include<stdio.h>
int main()
{
    int a;
    int i=0,m=0,n;
    scanf("%d",&a);
    n=a;
    for(i=0;i<n/10+1;i++)
    {
        m+=a%10;
        a/=10;
	}
    if(n%m==0)
    {
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    return 0;   
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;

int main() {
	int N; cin >> N;
	int A=N;
	int S=0;
	vector<int> vec(10);

	rep(i,10) {
		if (A>0) {
			vec.at(i) = (A % 10);
			A = A / 10;
			S = S + vec.at(i);
		}
	}

	if (N%S == 0) cout << "Yes" << endl;
	else cout << "No" << endl;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main () {
	char str[16], *ptr;
	scanf ("%s", str);

	int sn = 0;
	int n = atoi (str);
	ptr = str;
	while (*ptr >= '0' && *ptr <= '9')
		sn += (int) (*ptr++ - '0');

	if (n%sn == 0)
		printf ("Yes\n");
	else 
		printf ("No\n");

	return 0;
}
//  [c]
#include<stdio.h>
int main(void)
{
    long int n,m,i,j,s=0;
    scanf("%ld",&n);
    m=n;
    while(m/10!=0){
        j=m%10;
        s+=j;
        m=(m-j)/10;
    }
    s+=m;
    if(n%s==0)
        printf("Yes\n");
    else 
        printf("No\n");
    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
  int a1;
  scanf("%d",&a1);
  int a=a1;
  int sum=0;
  while (a!=0)
  {
      sum=sum+(a%10);
      a=a/10;
  }
  if((a1%sum)==0)
    printf("Yes");
  else
    printf("No");
}
//  [c]
#include<stdio.h>
int main()
{
    long long int num,r,s=0;
    scanf("%lld",&num);
    long long int res = num;
    while(num>0)
    {
        r=num%10;
        s+=r;
        num=num/10;
    }

   long long int rem = res%s;
   if(rem==0)
   {
       printf("Yes\n");
   }
   else
   {
       printf("No\n");
   }
    return 0;
}
//  [c]
#include <stdio.h>
int main(void){
  int N;
  int s;
  int i;
  int o;
  scanf("%d",&N);
  o=N;
  for(i=0;i<10;i++){
    int a;
    if(o==0){
      break;
    }
    else{
      a=o%10;
      s=s+a;
      o=o/10;
    }
  }
  if(N%s==0){
    printf("Yes\n");
  }
  else{
    printf("No\n");
  }
  return 0;
}
//  [c]
#include<stdio.h>

int main()
{
    int n,temp,sum = 0;
    scanf("%d",&n);
    temp = n;
    while(temp){
        sum = sum + (temp%10);
        temp = temp/10;
    }

    if(n % sum == 0)
        printf("Yes");
    else
        printf("No");
    return 0;
}
//  [javascript]
function Main(input) {
    var n = input;
    input = input.split("").map(Number);
    var sum = 0;
    for(var i=0;i<input.length;i++){
        sum += input[i];
    }
    console.log(n%sum==0?"Yes":"No")
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function Main(input) {
  var s = input.split('');
  var result = 0;
  for (var i = 0; i < s.length; i++) {
    result = result + +s[i];
  }
  
  if(input % result === 0) {
    console.log('Yes');
  } else {
    console.log('No');
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict"

function main(input) {

    let num = Number(input.split('\n')[0])
    let n = input.length
    let tmp = num
    let sum = 0
    for (let i = 1; i <= n; i++) {
        sum += tmp % 10 //一の位
        tmp = Math.floor(tmp / 10) //一桁削る
            // or 
            //tmp = (tmp-(tmp % 10) / 10
    }
    if (num % sum == 0) console.log('Yes')
    else console.log('No')
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {
	a=input.split('\n')[0];
	console.log(a%a.split('').reduce((x,y)=>~~x+~~y)?'No':'Yes');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(s){
	s|=0;
	var st=String(s);
	var a=0;
	var ans="Yes";
	for(var i=0;i<st.length;i=(i+1)|0){
		a+=st[i]|0;
	}
	if(s%a){ans="No";}
	
	console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
	var s = input.trim();
	var sum = 0;
	for(var i=0;i<s.length;i++){
		sum+=Number(s[i]);
	}
	if(Number(s) % sum == 0){
		console.log('Yes');
	} else {
		console.log('No');
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
        "fmt"
)

func d(n int) int{
        sum := 0
        for n > 0{
                sum += n % 10
                n = n / 10
        }
        return sum
}

func main(){
        var n int
        fmt.Scan(&n)

        s := d(n)

        if n % s == 0{
                fmt.Println("Yes")
        }else{
                fmt.Println("No")
        }
}
//  [go]
package main

import (
  "fmt"
)

func main() {
  var n int 
  fmt.Scan(&n)
  m := n
  s := 0
  for n > 0 {
    s += n % 10
    n /= 10
  }
  ans := "No"
  if m % s == 0 {
    ans = "Yes"
  }
  fmt.Println(ans)
}
//  [go]
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var b string
	fmt.Scan(&b)

	numStrs := strings.Split(b, "")
	var sum int
	for _, numStr := range numStrs {
		num, _ := strconv.Atoi(numStr)
		sum += num
	}

	num, _ := strconv.Atoi(b)
	if num%sum == 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	n := iScan()
	m := n
	d := 0
	for n != 0 {
		d += n % 10
		n /= 10
	}
	if m%d == 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	sn := 0
	n := N
	for n > 0 {
		sn += n % 10
		n /= 10
	}
	if N%sn == 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [ruby]
s = gets.split("")
t = s.map(&:to_i)

if s.join.to_i % t.inject(&:+) == 0
  puts "Yes"
else
  puts "No"
end
//  [ruby]
puts [:Yes][gets.to_i.%eval$_.chars*?++?0]||:No
//  [ruby]
n = gets.strip.split('')
s_n = n.map(&:to_i).inject(:+)
n = n.join.to_i

print n % s_n == 0 ? 'Yes' : 'No'
//  [ruby]
n=gets.to_i
puts n%n.to_s.split('').map(&:to_i).sum==0?'Yes':'No'
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

N = get_int

sn = N.to_s.split('').map(&:to_i).sum

if N % sn == 0
  puts 'Yes'
else
  puts 'No'
end
//  [ruby]
n = gets.to_i
a = (n.to_s).split("").map(&:to_i)
if n%a.sum==0
  puts "Yes"
else
  puts "No"
end
//  [rust]
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let s = buf.clone();
	let v:Vec<char> = buf.trim().chars().collect();
	let n:i32 = s.trim().parse().ok().unwrap();
	let mut dig:i32 = 0;
	for i in 0..v.len() {
		dig += (v[i] as i32) - ('0' as i32);
	}
	if n%dig == 0 {
		println!("Yes");
	}else{
		println!("No");
	}
}
//  [rust]
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: u32 = read();
    let ns = n.to_string();
    let nc: Vec<u32> = ns.chars().map(|x| x.to_digit(10).unwrap()).collect();
    let sum: u32 = nc.iter().sum();

    if n % sum == 0 {
        println!("Yes")
    } else {
        println!("No")
    }
}
//  [rust]
use proconio::{fastout, input};

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[fastout]
fn main() {
    input! {
        n: u32,
    }

    let sn: u32 = n.to_string().chars().map(|a| a.to_digit(10).unwrap()).sum();
    let ans = if n % sn == 0 { "Yes" } else { "No" };
    println!("{}", ans);
}
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    let a: usize = read!();
    let mut sum: usize = 0;
    let b: Vec<usize> = a.to_string().chars().map(|a|a.to_digit(10).unwrap() as usize).collect_vec();
    for i in 0..b.len() {
        sum+=b[i];
    }
    println!("{}",if a%sum==0 {"Yes"}else{"No"})
}
//  [rust]
use text_io::*;
use itertools::Itertools;

fn main() {
    let a: usize = read!();
    let mut sum: usize = 0;
    let b: Vec<usize> = a.to_string().chars().map(|a|a.to_digit(10).unwrap() as usize).collect_vec();
    for i in 0..b.len() {
        sum+=b[i];
    }
    println!("{}",if a%sum==0 {"Yes"}else{"No"})
}
//  [swift]
let input = readLine()!
let N = Int(input)!
let sum = input.characters.reduce(0){$0+Int(String($1))!}
print(N % sum == 0 ? "Yes" : "No")
//  [swift]
import Foundation

let inputString = readLine()!
let inputNum = Int(inputString)!
let sum = inputString.map(String.init).map { Int($0)! }.reduce(0, +)
print(inputNum % sum == 0 ? "Yes" : "No")
//  [swift]
let n = readLine()!
var sum = 0
for c in n { sum += Int(String(c))! }
print(Int(n)! % sum == 0 ? "Yes" : "No")
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc101 {
    class Program {
        constructor(private readonly args: string[]) {
        }

        main(this: Program): void {
            const n: number = parseInt(this.args[0], 10);
            const s: number = n.toString().split('').reduce((acc: number, cuu: string) => {
                return acc + parseInt(cuu, 10);
            }, 0);

            n % s === 0 ? console.log('Yes') : console.log('No');
        }
    }

    const args = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
    const prg = new Program(args);
    prg.main();
}
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};
const main=()=>{
  let s=ts()
  let w=0
  for(let i=0;i<s.length;i++){
    w+=Number(s[i])
  }
  to(Number(s)%w==0?'Yes':'No')
}
main()
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const _n = stdin.split('\n')[0]
const n = Number(_n)
const nArr = _n.split('').map(Number)

const sum = nArr.reduce((p, c) => p + c)

console.log(n % sum === 0 ? 'Yes' : 'No')
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const N = Number(input[0][0]);

  const digitSum = N.toString()
    .split("")
    .map(Number)
    .reduce((sum, cur) => sum + cur);

  return N % digitSum === 0 ? "Yes" : "No";
};

console.log(main(read()));
//  [typescript]
const Main = (input: string): void => {
	const num = parseInt(input)
	const ary = input.trim().split("")
	let sum = 0
	for (let i = 0; i < ary.length; i++) {
		sum += parseInt(ary[i])
	}
	const div: number = num % sum
	const ret: boolean = div === 0
	console.log(ret ? "Yes" : "No")
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"))
//  [python]
a,b,c = map(int, raw_input().split())
print 'Yes' if a + b >= c else 'No'
//  [python]
a,b,c=map(int,input().split())
print("Yes" if c<=(a+b) else "No")
//  [python]
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


a, b, c = MI()
print('Yes' if a + b >= c else 'No')
//  [java]
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            br.lines()
                .map(line -> Arrays.stream(line.split(" "))
                        .mapToInt(Integer::parseInt)
                        .toArray())
                .forEach(tokens -> {
                 int a = tokens[0];
                 int b = tokens[1];
                 int c = tokens[2];
                 
                    if(a+b>=c){
                         System.out.println("Yes");
                    }else{
                        System.out.println("No");
                        }
                 
                });
        

        }
    }
}
//  [java]
import java.util.*;

public class Main { 
public static void main(String[] args) {
 Scanner in = new Scanner(System.in);
 int a = in.nextInt(), b =  in.nextInt(), c = in.nextInt();
  if(a + b >= c) {System.out.println("Yes");}
  else {System.out.println("No");
}
}
}
//  [java]

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskX {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			int a = in.nextInt();
			int b = in.nextInt();
			int c = in.nextInt();
			String ans = "";
			if (a+b>=c) {
				ans = "Yes";
			} else {
				ans = "No";
			}
			out.println(ans);
		}
	}

	static class ArrayUtils {
		public static Map<Integer, Integer> getCountMap(int[] array) {
			Map<Integer, Integer> map = new TreeMap<>();
			for (int x : array)
				map.merge(x, 1, Integer::sum);
			return map;
		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}

	}

}
//  [cpp]
#include <stdio.h>

int main(void)
{
 int a,b,c;
 int cnt =0;
 
 scanf("%d %d %d",&a,&b,&c);

 if((a+b)>=c)
  cnt++;

 if(cnt!=0)
  printf("Yes");
 else
  printf("No");

 return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  int a,b,c;
  cin>>a>>b>>c;
  string ans="No";
  if(a+b>=c)ans="Yes";
  cout(ans);
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int

int main(){
int a,b,c;
cin>>a>>b>>c;
if(a+b>=c)
cout<<"Yes"<<endl;
else
{
  cout<<"No"<<endl;
}




  return 0;
}
//  [c]
#include<stdio.h>
int main()
{
        int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	if(a+b>=c)
		printf("Yes");
	else 
		printf("No");
}
//  [c]
#include<stdio.h>
#include<math.h>

int main(){

  long long a,b,c;
  scanf("%lld%lld%lld",&a,&b,&c);
  

  if(c<=a+b){
    printf("Yes");
  }
  else{
    printf("No");
  }
    


  return 0;
}
//  [c]
#include <stdio.h>

int main()
{
	int A, B, C;
	scanf("%d %d %d", &A, &B, &C);
	if (C <= A + B) printf("Yes\n");
	else printf("No\n");
	fflush(stdout);
	return 0;
}
//  [javascript]
'use strict'

function main(s) {

  s = s.split('\n')[0].split(' ');
  const a = Number(s[0]);
  const b = Number(s[1]);
  const c = Number(s[2]);

  const ans = ((a + b) >= c) ? 'Yes' : 'No';
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(s) {
	s = s.split(" ").map(a => parseInt(a));
	
	console.log(s[0] + s[1] >= s[2] ? "Yes" : "No");
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
  var input = input.split('\n');
  var answer;

  var nums = input[0].split(' ');
  nums = nums.map((e) => parseInt(e));

  answer = nums[0] + nums[1] >= nums[2];

  // 出力
  console.log(answer ? 'Yes' : 'No');
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import "fmt"

func main() {
	// Code for A - Two Coins
	var A, B, C int
	fmt.Scanf("%d %d %d", &A, &B, &C)
	if A+B >= C {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	A, B, C := ReadInt(), ReadInt(), ReadInt()
	if C <= A+B {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}
//  [go]
package main

import "fmt"

func main() {
  var a,b,c int
  fmt.Scanf("%d %d %d", &a,&b,&c)
 
  if c <= a+b {
    fmt.Println("Yes")
  } else {
    fmt.Println("No")
  }
}
//  [ruby]
A,B,C=gets.split.map(&:to_i)
puts A+B>=C ? "Yes" : "No"
//  [ruby]
*a,b=gets.split.map(&:to_i)
puts a.sum<b ?"No":"Yes"
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

A, B, C = get_ints

if A + B >= C
  puts 'Yes'
else
  puts 'No'
end
//  [rust]
use proconio::fastout;
use whiteread::parse_line;

#[fastout]
fn main() {
    let (a, b, c): (usize, usize, usize) = parse_line().unwrap();
    if c <= a + b {
        println!("Yes");
    } else {
        println!("No");
    }
}
//  [rust]
#[allow(unused_macros)]
macro_rules ! read_value {($ next : expr , ($ ($ t : tt ) ,* ) ) => {($ (read_value ! ($ next , $ t ) ) ,* ) } ; ($ next : expr , [$ t : tt ; $ len : expr ] ) => {(0 ..$ len ) . map (| _ | read_value ! ($ next , $ t ) ) . collect ::< Vec < _ >> () } ; ($ next : expr , chars ) => {read_value ! ($ next , String ) . chars () . collect ::< Vec < char >> () } ; ($ next : expr , usize1 ) => {read_value ! ($ next , usize ) - 1 } ; ($ next : expr , $ t : ty ) => {$ next () . parse ::<$ t > () . expect ("Parse error" ) } ; }
#[allow(unused_macros)]
macro_rules ! input_inner {($ next : expr ) => {} ; ($ next : expr , ) => {} ; ($ next : expr , $ var : ident : $ t : tt $ ($ r : tt ) * ) => {let $ var = read_value ! ($ next , $ t ) ; input_inner ! {$ next $ ($ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input {(source = $ s : expr , $ ($ r : tt ) * ) => {let mut iter = $ s . split_whitespace () ; let mut next = || {iter . next () . unwrap () } ; input_inner ! {next , $ ($ r ) * } } ; ($ ($ r : tt ) * ) => {let stdin = std :: io :: stdin () ; let mut bytes = std :: io :: Read :: bytes (std :: io :: BufReader :: new (stdin . lock () ) ) ; let mut next = move || -> String {bytes . by_ref () . map (| r | r . unwrap () as char ) . skip_while (| c | c . is_whitespace () ) . take_while (| c |! c . is_whitespace () ) . collect () } ; input_inner ! {next , $ ($ r ) * } } ; }

fn main() {
    input! {
        a: i32,
        b: i32,
        c: i32,
    }
    if a + b >= c {
        println!("Yes");
    } else {
        println!("No");
    }
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [A, B, C] = input[0].map(Number);

  return A + B >= C ? "Yes" : "No";
};

console.log(main(read()));
//  [typescript]
var lines: string[] = [];
var reader: any = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on("line", function(line: string) {
  lines.push(line);
});

reader.on("close", function() {
  // A,B,C
  var numbers: number[] = lines[0].split(" ").map(x => {
    return Number(x);
  });
  if (numbers[0] + numbers[1] >= numbers[2]) {
    console.log("Yes");
  } else {
    console.log("No");
  }
});
//  [typescript]
import * as fs from "fs";
const input = (fs.readFileSync("/dev/stdin", "utf8") as string)
  .split(/\s/)
  .map(Number);
console.log(input[0] + input[1] >= input[2] ? "Yes" : "No");
//  [python]
N, K = map(int, raw_input().split())
l = map(int, raw_input().split())
l.sort()
print sum(l[-K:])
//  [python]
N,K = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
print(sum(l[-K:]))
//  [python]
n,k=map(int,input().split())
l=list(map(int,input().split()))

sl=sorted(l)
print(sum(sl[-k:]))
//  [python]
n,k = map(int, raw_input().split())
ais = map(int, raw_input().split())
ais.sort()
print sum(ais[-k:] or [0])
//  [python]
n,k=map(int,input().split())
lst=sorted(map(int,input().split()))

print(sum(lst[:-k-1:-1]))
//  [python]
# -*- coding:utf-8 -*-
import itertools
import numpy as np

N,K = map(int,input().split())
l = np.array(list(map(int,input().split())))

ans = 0
for i in range(K):
    max_i = np.argmax(l)
    ans += l[max_i]
    l = np.delete(l,max_i)

print(ans)
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;

public class Main {

	static PrintWriter out;
	static InputReader ir;

	static void solve() {
		int n=ir.nextInt();
		int k=ir.nextInt();
		int[] a=ir.nextIntArray(n);
		Arrays.sort(a);
		int ret=0;
		for(int i=0;i<k;i++)
			ret+=a[n-1-i];
		out.println(ret);
	}

	public static void main(String[] args) throws Exception {
		ir = new InputReader(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.flush();
	}

	static class InputReader {

		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;

		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}

		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}

		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}

		public boolean hasNext() {
			skip();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
}
//  [java]
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] info = sc.nextLine().split(" ");
		int N=Integer.parseInt(info[0]);
		int K=Integer.parseInt(info[1]);
		Integer result=Arrays.asList(sc.nextLine().split(" "))
				.stream()
				.map(Integer::valueOf)
				.sorted(Comparator.reverseOrder())
				.collect(Collectors.toList())
				.subList(0, K)
				.stream()
				.mapToInt(Integer::valueOf)
				.sum();
		System.out.println(result);
	}
}
//  [java]
import java.util.*;

/**
 * Created by DELL on 2017/7/15.
 */
public class Main {




    public static void main(String[] args) {
        Scanner in=new Scanner(System.in
        );
        List<Integer> list=new ArrayList();
        int N=in.nextInt();
        int K=in.nextInt();
        for (int i = 0; i < N; i++) {
            list.add(in.nextInt());
        }
        Collections.sort(list);
        System.out.println(list.parallelStream().sorted(Comparator.comparing(x->-x)).mapToInt(x->x).limit(K).sum());


    }
}
//  [java]
import java.util.*;
import java.util.stream.*;
class Main{
    public static void main(String[]$){
        Scanner s=new Scanner(System.in);
        int n=s.nextInt(),k=s.nextInt();
        System.out.println(IntStream.range(0,n).map(i->s.nextInt()).sorted().skip(n-k).sum());
    }
}
//  [cpp]
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

int a[6000];
bool cmp(int x , int y)
{
	return x > y;
}

int main()
{
	int n , m;
	scanf("%d %d",&n ,&m);
	for(int i = 1 ; i <= n ; i++){
		scanf("%d",&a[i]);
	}
	sort(a + 1 , a + 1 + n , cmp);
	int sum = 0;
	for(int i = 1 ; i <= m ; i++) sum += a[i];
	printf("%d\n",sum);
}
//  [cpp]
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
int a[50];

int cmp(int x, int y){
	return x > y;
}
int main()
{
	int n,k, sum = 0;
	scanf("%d%d",&n,&k);
	for(int i = 1; i <= n; i++)
		scanf("%d",&a[i]);
	sort(a + 1,a + n + 1, cmp);
	for(int i = 1; i <= k; i++)
		sum += a[i];
	printf("%d\n",sum);

	return 0;
}
//  [cpp]
#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
	int a,b,i,c[55],sum=0;
	scanf("%d %d",&a,&b);
	for(i=0;i<a;i++)
	{
		scanf("%d",&c[i]);	
	}
	sort(c,c+a);
	while(b--)
	{
		sum+=c[i-1];
		i--;
	}
	printf("%d\n",sum);
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define AC(x,t) accumulate(ALL(x),t)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int N, K, res{};
vector<int> vc;
vector<vector<vector<int>>> visited( 50 + 1, vector<vector<int>>( 10000 + 1, vector<int>( 50 + 1, -1 )));
bool dfs( int i, int sum, int cnt )
{
    int &memo = visited[ i ][ sum ][ cnt ];
    if( memo != -1 )
    {
        return memo;
    }
    if( cnt == K )
    {
        res = max( res, sum );
        return 0;
    }
    if( i == N )
    {
        return 0;
    }
    return ( memo = dfs( i + 1, sum, cnt ) || dfs( i + 1, sum + vc[ i ], cnt + 1 ) );
}
int main()
{
    cin >> N >> K;
    vc.resize( N );
    for( auto &x : vc )
    {
        cin >> x;
    }
    dfs( 0, 0, 0 );
    cout << res << endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, k, ans=0;
    vector<int> a(n);
    cin >> n >> k;

    for(int i=0; i<n; i++) {
        cin >> a.at(i);
    }

    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());

    for(int j=0; j<k; j++){
        ans += a.at(j);
    }

    cout << ans << endl;
 
}
//  [cpp]
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<iomanip>
#include <math.h>
using namespace std;
int main(){
    int n,k,s=0;
    cin>>n>>k;
    vector<int>a(1000000);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a.begin(),a.end(),greater<>());
    for(int i=0;i<k;i++){
        s+=a[i];
    }
    cout<<s<<endl;
    
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#define MOD 1000000007
#define ll long long

int cmpfunc(const void *a, const void *b){
    return *(int *)b - *(int *)a;
}

int main(int argc, char **argv){
    int n,k;
    scanf("%d %d",&n,&k);
    int l[n];
    int i;
    for(i=0;i<n;i++) scanf("%d",&l[i]);
    qsort(l,n,sizeof(int),cmpfunc);
    int ans=0;
    for(i=0;i<k;i++) ans+=l[i];
    printf("%d\n",ans);
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

#define IN(a) int a;scanf("%d",&a);
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define STRS(i,str) for(int i=0;(str)[i];i++)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX3(a,b,c) ((a)>(b)?(a)>(c)?(a):(c):(b)>(c)?(b):(c))
#define MIN3(a,b,c) ((a)<(b)?(a)<(c)?(a):(c):(b)<(c)?(b):(c))
#define RANGE(a,b) ((a)>(b)?(a)-(b):(b)-(a))
#define RANGE3(a,b,c) ((a)>(b)?(b)>(c)?(a)-(c):(c)>(a)?(c)-(b):(a)-(b):(b)>(c)?(c)>(a)?(b)-(a):(b)-(c):(c)-(a))
#define MAXI(a,b) if(a<b)a=b;
#define MINI(a,b) if(a>b)a=b;

int main(void){
	int n, k;
	int l[60];
	int ans = 0;
	scanf("%d%d", &n, &k);
	REP(i, n + 1) l[i] = 0;

	scanf("%d", l);
	FOR(i, 1, n){
		scanf("%d", l + i);
		int j = i;
		while(l[j] > l[(j - 1)/2]){
			int tmp = l[j];
			l[j] = l[(j - 1)/2];
			l[(j - 1)/2] = tmp;
			j = (j - 1)/2;
		}
	}

#ifdef DEBUG
	REP(i, n) printf("%d ", l[i]);
	putchar('\n');
#endif

	int size = n;
	REP(i, k){
		size--;
		ans += l[0];
		l[0] = l[size];
		int j = 0, tmp = l[j];
		for(;;){
			if((j*2 + 1 < size && l[j*2 + 1] > l[j*2 + 2] || j*2 + 1 == size) && l[j] < l[j*2 + 1]){
				l[j] = l[j*2 + 1];
				l[j*2 + 1] = tmp;
				j = j*2 + 1;
			}else if(j*2 + 1 < size && l[j] < l[j*2 + 2]){
				l[j] = l[j*2 + 2];
				l[j*2 + 2] = tmp;
				j = j*2 + 2;
			}else break;
		}
		
		#ifdef DEBUG
		REP(m, size) printf("%d ", l[m]);
		putchar('\n');
		#endif
	}

	printf("%d\n", ans);

	return 0;
}
//  [c]

#include <stdio.h>
#include <stdlib.h>

int main(void){
        int n,k;
        int i=scanf("%d",&n);
        int j=scanf("%d",&k);
        if(i<1||j<1){
                printf("error");
                exit(1);
        }

        int l[n];
        for(int i=0;i<n;i++){
                j=scanf("%d",&l[i]);
                if(j<1){
                        printf("Error");
                        exit(1);
                }
        }

        int tmp=0;
        for(int i=1;i<n;i++){
                for(int j=i;j>0;j--){
                        if(l[j-1]<l[j]){
                                tmp=l[j-1];
                                l[j-1]=l[j];
                                l[j]=tmp;
                        }else{
                                break;
                        }
                }
        }

        int sum=0;
        for(int i=0;i<k;i++){
                sum+=l[i];
        }
        printf("%d",sum);
        return 0;
}
//  [c]
#include <stdio.h>

void sort(int *a,int n)
{
        int i,j,index,max;
        for(i=0;i<n;i++){
                max=a[i];index=i;
                for(j=i+1;j<n;j++)
                        if(max<a[j]){
                                max=a[j];index=j;
                        }
                a[index]=a[i];a[i]=max;
        }
        return ;
}
int main(void)
{
        int k,n,i,s=0;
        scanf("%d%d",&n,&k);
        int l[n];
        for(i=0;i<n;i++)
                scanf("%d",&l[i]);
        sort(l,n);
        for(i=0;i<k;i++)
                s+=l[i];
        printf("%d\n",s);
        return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int compare(const void *a, const void *b) {
	int A, B;
	A = *(int *)a;
	B = *(int *)b;
	if(A > B) {
		return -1;
	} else if(A < B) {
		return 1;
	} else {
		return 0;
	}
}

int main(void) {
	int i;
	int N, K, ans;
	int *l;
	char buf[512], *ch;

	fgets(buf, sizeof(buf), stdin);
	ch = strtok(buf, " ");
	N = atoi(ch);
	ch = strtok(NULL, " ");
	K = atoi(ch);

	l = (int *)calloc(N, sizeof(int));
	fgets(buf, sizeof(buf), stdin);
	ch = strtok(buf, " ");
	l[0] = atoi(ch);
	for(i = 1; i < N; i += 1){
		ch = strtok(NULL, " ");
		l[i] = atoi(ch);
	}
	qsort(l, N, sizeof(int), compare);
	ans = 0;
	for(i = 0; i < K; i += 1) {
		ans += l[i];
	}

	printf("%d\n", ans);

	free(l);
	return 0;
}
//  [c]
#include <stdio.h>

int main(void){
  int N, K, length[50], i, j, save, sum = 0;
  scanf("%d %d", &N, &K);
  for(i=0; i<N; i++) scanf("%d",&length[i]);
  for(i=0; i<N; i++){
    for(j=i+1; j<N; j++){
      if(length[i] < length[j]){
        save = length[i];
        length[i] = length[j];
        length[j] = save;
      }
    }
  }
  for(i=0; i<K; i++) sum =sum + length[i];
  printf("%d",sum);
  return 0;
}
//  [javascript]
'use strict'
function Main(input) {
    input = input.split("\n");
    const n = parseInt(input[0].split(' ')[1], 10)
    const arr = input[1].split(' ').map(v => parseInt(v, 10)).sort((a,b) => b - a)
    let sum = 0;
    for (let i = 0; i < n; i ++) {
        sum += arr[i]
    }
    console.log(sum)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main (input) {
    const N = input.split('\n')[0].split(' ')[0];
    const K = input.split('\n')[0].split(' ')[1];
    const l = input.split('\n')[1].split(' ')
                 .map(function(e){return Number(e);})
                 .sort(function(a,b){return b-a;});
    ans = 0;

    for (var i = 0; i < K; i++) {
        ans = ans + l[i];
    }
    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input, "index" : 0, "max" : input.length,
  "hasNext" : function(){return (this.index < this.max);},
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  }
}
Main();
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextIntArray();
  var N = one[0];
  var K = one[1];
  var list = nextIntArray();
  list.sort(function(a,b){
  	return b - a;
  });
  var output = 0;
  for(var i = 0; i < K; i++){
    output += list[i];
  }
  myout(output);
}