A series of $$n$$ integers is called a caper if the absolute values of the differences between the consecutive values from the sequence assume all the values between 1 and $$n - 1$$. For example, the series

1 4 2 3

is a caper, because the absolute differences are respectively equal to 3, 2 and 1. The definition states that each sequence which consists of one single integer is a caper. Write a program that determines whether a given set of integers is a caper or not.

Assignment

Write a function caper that takes a list of integers as argument and returns a Boolean value as a result. If the list of numbers that is passed as an argument is a caper, this function returns the value True. Otherwise, the function returns the value False.

Example

>>> caper([1, 4, 2, 3])
True
>>> caper([1, 4, 2, 3, -1, 6])
False