Driver code
public static void main ( String [ ] args ) { String str = " GeeksforGeeks " ; if ( checkValidity ( str ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }