OrderedQ
OrderedQ[h[e1, e2, …]] gives True if the ei are in canonical order, and False otherwise.
OrderedQ[h[e1, e2, …], p] uses the ordering function p.
Examples
Check canonical order:
OrderedQ[{a, b, c}]
(* True *)Not in order:
OrderedQ[{c, a, b}]
(* False *)Please visit the official Wolfram Language Reference for more details.