CodeMat
Source: codechef
Difficulty: 183

CodeMat
Code-mat
is an annual programming competition organized by the
Mathematics and Computing Society (MACS)
at
IIT BHU
. Last year, the event had$X$participants, while this year it attracted$Y$participants. Determine whether this year's event was more successful by checking if$Y$is greater than$X$. If it was more successful, print Yes. Otherwise, print No.
Input Format
The input consists of two space-separated integers$X$and$Y$, where:$X$denotes the number of participants last year.$Y$denotes the number of participants this year.
Output Format
Print
YES
if this year's event had more participants than last year, otherwise print
NO
.
You may print each character of the string in uppercase or lowercase (for example, the strings
YES
,
yEs
,
yes
, and
yeS
will all be treated as identical).
Constraints$1 \leq X \leq 1000$$1 \leq Y \leq 1000$Sample 1:
Explanation:
Since this year's event attracted more participants and was more successful, so the answer is
Yes
.
Sample 2:
Input
Output
976 899
No
Explanation:
Since fewer participants attended this year compared to last year, so the answer is
No
.
Sample 3:
Input
Output
250 250
No
Explanation:
This year's event was not more successful than the previous year, as the number of participants remained the same. So, the answer is
No
.

Sample Input:
234 643

Sample Output:
Yes

C++ solution:
#include <bits/stdc++.h>
using namespace std;

int main() {
    // your code goes here
    int x,y;
    cin>>x>>y;
    if(y>x){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
}

Go solution:
//starting of the code4
package main

import "fmt"

func main() {
        var x, y int
        fmt.Scan(&x, &y)

        if y > x {
                fmt.Println("Yes")
        } else {
                fmt.Println("No")
        }
}
//ending of the codee

Java solution:
import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        Scanner s= new Scanner(System.in);
        int x=s.nextInt();
        int y=s.nextInt();
        if(x<y)
        {
            System.out.println("yes");
        }
        else{
            System.out.println("No");
        }
    }
}

JavaScript solution:
// your code goes here
let stdInput = "";

process.stdin.on("data" , input => stdInput += input);

process.stdin.on("end" , () =>{
    const [x , y] = stdInput.trim().split(" ").map(Number);
    if (x < y){
        console.log("Yes");
    }else{
        console.log("No");
    }
})

Python solution:
X,Y=map(int,input().split())
if Y>X:
    print("YES")
else:
    print("NO")

Ruby solution:
# Read input as a single line and split into two integers
input_line = gets.to_s.chomp
participants = input_line.split.map(&:to_i)

# Ensure we have exactly two valid numbers
if participants.size == 2
  last_year, this_year = participants
  # Compare and output result
  puts this_year > last_year ? "YES" : "NO"
else
  puts "NO" # Fallback for invalid input format
end