program match;

function MatchIdx(var p, s: string; i, j: integer): boolean;
begin
    if i > length(p) then
        MatchIdx := j > length(s)
    else if p[i] = '*' then
        MatchIdx := MatchIdx(p, s, i + 1, j) or
            ((j <= length(s)) and MatchIdx(p, s, i, j + 1))
    else if (j <= length(s)) and ((s[j] = p[i]) or (p[i] = '?')) then
        MatchIdx := MatchIdx(p, s, i + 1, j + 1)
    else
        MatchIdx := false
end;

function Match(p, s: string): boolean;
begin
    Match := MatchIdx(p, s, 1, 1)
end;

begin
    if ParamCount <> 2 then begin
        writeln(ErrOutput, 'usage: ', ParamStr(0), ' pattern string');
        halt(2)
    end;
    if Match(ParamStr(1), ParamStr(2)) then
        writeln('yes')
    else
        writeln('no')
end.
