# Problem with If statement

It is a very simple problem but I am confused. A comment is required. I have the following list

masters={C18[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0],
C18[1, 1, 1, 1, 1, 1, 0, 1, 1, 2, 0, 0]}


Now if I write

If [C18[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0] == masters[[2]],
Print["Yes"], Print["No"]]


It should give No , but it is giving

If[C18[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0] ==
C18[1, 1, 1, 1, 1, 1, 0, 1, 1, 2, 0, 0], Print["Yes"], Print["No"]]


Where is the problem?

masters = {C18[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0],
C18[1, 1, 1, 1, 1, 1, 0, 1, 1, 2, 0, 0]};


C18 is an undefined function. Since neither expression evaluates, it is unknown whether the expressions are Equal

If[C18[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0] == masters[[2]], Print["Yes"],
Print["No"], Print["Unknown"]]

(* Unknown *)


Use SameQ to check whether the unevaluated expressions are identical.

If[C18[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0] === masters[[2]], Print["Yes"],
Print["No"], Print["Unknown"]]

(* No *)