Two numbers in a row

Report a typo

Write a program that reads a list 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 list.

Input data format

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

Output data format

Print "NO" if the numbers are next to each other or "YES" if p and m are never near each other

Sample Input 1:

3
1
2
3
2 3

Sample Output 1:

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

Create a free account to access the full topic