class Utilities {

    public static boolean isSequential(int[] ints)
    {
        if (ints.length > 1)
        {
            // Check that the array does not cross Integer.MAX_VALUE.
            int delta = ints[0] - ints[1];
            if (delta != 1 && delta != -1 || (delta > 0 ? ints[0] < ints[ints.length - 1] : ints[0] > ints[ints.length - 1]))
            {
                return false;
            }
            for (int index = 1; index < ints.length - 1;)
            {
                if (ints[index] - ints[++index] != delta)
                {
                    return false;
                }
            }
        }
        return true;
    }

    private  Utilities();

}