program aaa
implicit none
 
integer :: one, two, three, four
integer, dimension(26) :: h = [2,3,5,7,11,13,17,19,23,29,31,37,&
41,43,47,53,59,61,67,71,73,79,83,89,97,101]
integer :: a, b, c
character(4) :: s
 
read*, s
 
one=h(iachar(s(1:1))-64)
two=h(iachar(s(2:2))-64)
three=h(iachar(s(3:3))-64)
four=h(iachar(s(4:4))-64)
 
a=(one*two)-(three*four)
b=(one*three)-(two*four)
c=(one*four)-(two*three)
 
if(a==b.and.a==c) then
write(*,'(a2)') 'No'
return
end if

if(a==0.or.b==0.or.c==0) then
write(*,'(a3)') 'Yes'
else
write(*,'(a2)') 'No'
end if
 
end program