← Back to List

7789번: 텔레프라임 ↗

Solutions

Python 3
187 B | 187 chars
def is_prime(n):
  n = int(n)
  for i in range(2, n):
    if n % i == 0:
      return False
  return True

a, b = input().split()

print("Yes" if is_prime(a) and is_prime(b+a) else "No")