Here is another approach
find_element:=proc(e,L::list)
local idx;
idx:=ListTools:-Search(e,L);
if idx=0 then
RETURN([]);
elif idx=nops(L) then
RETURN([L[idx]]);
else
RETURN(L[idx+1..-1]);
fi;
end proc;
is_in_order:=proc(N::list,lis::list)::truefalse;
local final_result::truefalse:=true;
local item,r::list:=lis;
for item in N do
r:=find_element(item,r);
if nops(r)=0 then
final_result:=false;
break;
fi;
od:
RETURN(final_result);
end proc:
and now
is_in_order([7,2,4],[2,6,5,7,3,2,9,4])
true
is_in_order([7,2,4],[2,1,4,2,6,7,3,9])
false
is_in_order([7,2,4],[7,4,2,7,2,4])
true
is_in_order([7,2,4],[7,7,7,7,2,2,2,7,4])
true