var a,b,c,d,e,f,m,l,i,dem,n:longint;
s:real; st:ansistring;
begin
write('Nhap so nguyen a: ');readln(a);
write('Nhap so nguyen b: ');readln(b);
if a>b then begin
if a mod 2014=0 then write('YES') else write('NO'); end;
if b>a then begin
if b mod 2014=0 then write('YES') else write('NO'); end;
readln;
end.