Driver Code
public static void Main ( ) { int [ ] arr = new int [ ] { 1 , 2 , 12 , 3 , 2 } ; int n = arr . Length ; if ( CheckArray ( arr , n ) ) System . Console . WriteLine ( " YES " ) ; else System . Console . WriteLine ( " NO " ) ; } }