Check the numbers

Report a typo

Write a program that reads an array of integers and two numbers p and m. The program is to check that p and m never occur next to each other (in any order) in the array.

Input data format

The first line contains the size of an array, N.
The next N lines contain elements of the array.
The last line contains two integer numbers p and m., separated by the space character.

Output data format

The result is a single value, that is, "YES" if p and m never occur next to each other, otherwise, "NO".

Sample Input 1:

3
1
2
3
2 3

Sample Output 1:

NO

Sample Input 2:

3
1
2
3
3 4

Sample Output 2:

YES
Write a program in Kotlin
fun main() {
// write your code here
}
___

Create a free account to access the full topic