#82. isEverywhere

isEverywhere

Background

Description

We'll say that a value is "everywhere" in an array if for every pair of adjacent elements in the array, at least one of the pair is that value. Return true if the given value is everywhere in the array.

Format

Input

Output

Samples

[1 2 1 3] 1
true
[1 2 1 3] 2
false
[1 2 1 3 4] 1
false

Limitation

1s, 1024KiB for each test case.