var a,b,c,d,i,j:longint;
begin
read(a,b);
for i:=1 to a-1 do
if a mod i=0 then c:=c+i;
for j:=1 to b-1 do
if b mod j=0 then d:=d+j;
if (d=a)and(b=c) then write('yes')
else write('no');
end.
/**************************************************************
	Problem: 1862
	User: admin
	Language: Pascal
	Result: Wrong Answer
****************************************************************/