Simplify the brute force valid check