Write a function to determine if a given binary tree is a valid Binary Search Tree.
Use the function signature is_valid_bst(root). Represent each node as an object with val, left, and right fields, where a missing child is null. Return true only when every node in the left subtree is strictly smaller and every node in the right subtree is strictly larger than the node's value. Duplicate values are invalid.
def is_valid_bst(root):