diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -1,7 +1,7 @@
 N = int(input())
 S = input()
 
-if "a" in S and "b" in S:
+if "ab" in S or "ba" in S:
     print("Yes")
 else:
     print("No")
