Files
CodeObject/storage/aloha/py/completed/2025cherry-div1-B.py
2025-05-17 17:25:42 +09:00

20 lines
376 B
Python

import sys
input = sys.stdin.readline
class SeongjunEncryption:
def __init__(self, n, t):
self.n = n
self.t = t
def solve(self) -> bool:
return self.t[0] == 'A' and self.t[-1] == 'B'
if __name__ == "__main__":
n = int(input())
t = input().strip()
print("Yes" if SeongjunEncryption(n, t).solve() else "No")