diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -1,6 +1,6 @@
 n = int(input())
 s = list(input())
-if "".join(s) == "AB":
+if "".join(s) == "BA":
     print("No")
     exit()
 if s[0] == "B":
