Files
CodeObject/storage/aloha/py/2025-cherry-div1-B.py
2026-05-04 15:03:11 +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")