compare element in a list prolog

From: kimos (urdad_at_hotmail.com)
Date: 09/23/04


Date: 23 Sep 2004 13:56:54 -0700

hi all,
im new to prolog

and im trying to make this pred.

compare[a,a,a,a].
yes

compare[a,e,a,t].
no

so if the element of the list are the same then its a yes if not then its a no

how can i do this?

i was trying this but it didnt work

compare([H|T]):-
element(H, [H|T]).
element(H, [H|T]):-
element(H,T).

but this is wronge. anyone can help me plz?