Element Hunt in the Array

Easy
2
29.4% Acceptance

Given an array BB of length MM and a target value YY, your objective is to determine the presence of YY within the array BB.

Input Specification

  • The opening line should include two integers separated by a space, MM and YY — representing the length of the array and the target value, respectively.
  • The subsequent line enumerates all elements contained within array BB.

Output Specification

Print "YES" if the target value YY is found within BB; print "NO" if it is not.

Boundary Conditions

  • 1M1051 \leq M \leq 10^5
  • 1Bi1051 \leq B_i \leq 10^5

Example Scenarios

Scenario #1:

Input:

5 3 7 3 5 2 1

Output:

YES

Scenario #2:

Input:

5 10 7 3 5 2 1

Output:

NO