var
NumeralS, NumberS : string;
Numeral, Number : integer;
i, k : integer;
Begin
readln(Numeral, Number);
NumberS := inttostr(Number);
NumeralS := inttostr(Numeral);
for i:=1 to length(NumberS) do
if NumberS[i] = NumeralS then
inc(k);
if k>0 then
writeln(True)
else
writeln(False);
end.
var
NumeralS, NumberS : string;
Numeral, Number : integer;
i, k : integer;
Begin
readln(Numeral, Number);
NumberS := inttostr(Number);
NumeralS := inttostr(Numeral);
for i:=1 to length(NumberS) do
if NumberS[i] = NumeralS then
inc(k);
if k>0 then
writeln(True)
else
writeln(False);
end.