Driver Code
public static void main ( String [ ] args ) { ArrayList a = new ArrayList ( ) ; a . add ( 3 ) ; a . add ( 3 ) ; a . add ( 3 ) ; a . add ( 3 ) ; int n = a . size ( ) ; if ( graphExists ( a , n ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " NO " ) ; } } }