diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -1,7 +1,7 @@
 S = input()
 T = input()
 
-g1 = ["AB", "BC", "CD", "DE", "EA"]
+g1 = ["AB", "BA", "BC", "CB", "CD", "DC", "DE", "ED", "EA", "AE"]
 
 if S in g1 and T in g1:
     print("Yes")
