a,n:array[1..4]of integer;
i,j,k:longint;
s:string;
check:array[1..4]of boolean;
procedure cal;
var i,j,k,sum:longint;
begin
for i:=1 to 4 do
for j:=1 to 4 do
for k:=1 to 4 do
begin
sum:=0;
case i of
1:sum:=n[1]+n[2];
2:sum:=n[1]-n[2];
3:sum:=n[1]*n[2];
4:if n[1] mod n[2]=0 then sum:=n[1] div n[2];
end;
case j of
1:sum:=sum+n[3];
2:sum:=sum-n[3];
3:sum:=sum*n[3];
4:if sum mod n[3]=0 then sum:=sum div n[3];
end;
case k of
1:sum:=sum+n[4];
2:sum:=sum-n[4];
3:sum:=sum*n[4];
4:if sum mod n[4]=0 then sum:=sum div n[4];
end;
if sum=24 then
begin
writeln('yes');
halt;
end;
end;
end;
procedure go(time,i:integer);
begin
if time>4 then
begin
cal;
exit;
end;
for i:=1 to 4 do
if not check[i]then
begin
check[i]:=true;
n[time]:=a[i];
go(time+1,0);
check[i]:=false;
end;
end;
begin
readln(s);
j:=1;
for i:=1 to length(s)do
begin
case s[i]of
'A':a[j]:=1;
'J':a[j]:=11;
'Q':a[j]:=12;
'K':a[j]:=13;
' ':inc(j);
else a[j]:=a[j]*10+ord(s[i])-48;
end;
end;
go(1,0);
writeln('no');
end.