var
 ch:char;
 i,a,b,f:longint;
begin
 readln(a,b);
 for i:=1 to a do begin read(ch);if ch<>['0'..'9'] then f:=1;end;
 if f=1 then begin writeln('No');halt;end;
 read(ch);
 if ch<>'-' then f:=1;
 if f=1 then begin writeln('No');halt;end;
 for i:=1 to b do begin read(ch);if ch<>['0'..'9'] then f:=1;end;
 if f=1 then begin writeln('No');halt;end;
 writeln('Yes');
end.