For this Question: In DSA class Priya was taught about the topic of Linked List, She has a curiosity in her mind, Can the traversal of the linked list be never-ending? As you are Priya's friend she asked this question, Given a linked list your task is to determine if its traversal is never-ending or not.<b>User Task</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>isNeverEnding()</b>, which takes the head Node of the list as the parameter, but for clarity input in <b>Sample Input</b> is defined as
The first line has two space-separated integers N and X, and the next line contains N space-separated integers denoting the List, Internally X is used to denote the index of the node that the tail's next pointer is connected to. 
<b>Note</b>: X is not passed as a parameter.

<b>Constraints</b>
1 &le; N &le; 10<sup>4</sup>
1 &le; X &le; N-1You don't have to worry about printing, return true if Priya's Curiosity is correct. Otherwise, return false. If true is returned then Yes will be printed otherwise No.<b>Sample Input</b>
4 2
1 2 3 4
<b>Sample Output</b>
Yes
<b>Explanation</b>
So here the traversal is never-ending as the last element of the list points to the 2nd element i. e. 2. The traversal of the linked list will be 1->2->3->4->2->3->4->2->3->...
Hence the output is Yes., I have written this Solution Code: 

    public static Boolean isNeverEnding(Node head) {
        if (head == null) {
            return false;
        }

        Node slow = head;
        Node fast = head.next;
        while (slow != fast) {
            if (fast == null || fast.next == null) {
                return false;
            }
            slow = slow.next;
            fast = fast.next.next;
        }
        return true;
    }

    , In this Programming Language: Java, Now tell me if this Code is compilable or not?