program ravn_kvsred_pr_krai;
var
x:integer;
begin
read(x);
if((x div 1000)*(x mod 10))=((x div 10 mod 10)*(x div 10 mod 10)+(x mod 100 div 10)*(x mod 100 div 10))
then
write('да')
else
write('нет')
end.
program ravn_kvsred_pr_krai;
var
x:integer;
begin
read(x);
if((x div 1000)*(x mod 10))=((x div 10 mod 10)*(x div 10 mod 10)+(x mod 100 div 10)*(x mod 100 div 10))
then
write('да')
else
write('нет')
end.