CF1013B And

Description

There is an array with $ n $ elements $ a_{1},a_{2},...,a_{n} $ and the number $ x $ . In one operation you can select some $ i $ ( $ 1

Input Format

The first line contains integers $ n $ and $ x $ ( $ 2

Output Format

Print a single integer denoting the minimal number of operations to do, or -1, if it is impossible.

Explanation/Hint

In the first example one can apply the operation to the last element of the array. That replaces 7 with 3, so we achieve the goal in one move. In the second example the array already has two equal elements. In the third example applying the operation won't change the array at all, so it is impossible to make some pair of elements equal.