Driver Code
public static void Main ( String [ ] args ) { String a = " aaba " ; String b = " abaa " ; if ( areEquivalent ( a , b ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; a = " aabb " ; b = " abab " ; if ( areEquivalent ( a , b ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }