diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -1,7 +1,7 @@
 n = int(input())
 s = input()
 for i in range(n - 1):
-    if s[i] + s[i + 1] == "ab":
+    if s[i] + s[i + 1] == "ab" or s[i] + s[i + 1] == "ba":
         print("Yes")
         break
 else:
