0
Regex (ECMAScript), 31 bytes
^(x{0,9})((x+)\3{8}(?=\3$)\1)*$
Takes input in unary, as usual for math regexes (note that the problem is trivial with decimal input: just ^(.)\1*$).
Explanation:
^(x{0,9}) # \1 = candidate digit, N -= \1
( # Loop the following:
(x+)...