Driver Code
public static void Main ( String [ ] args ) { int [ ] arr = { 2 , - 1 , 1 , 2 , 2 } ; int n = arr . Length ; if ( isCycle ( arr , n ) == true ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }