Driver code
public static void main ( String [ ] args ) { int N = 1 , M = 1 ; String str = " R " ; if ( isSafe ( N , M , str . toCharArray ( ) ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }