Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT res = False NEW_LINE root = Node ( 5 ) NEW_LINE root . left = Node ( 1 ) NEW_LINE root . right = Node ( 6 ) NEW_LINE root . left . left = Node ( 3 ) NEW_LINE root . right . left = Node ( 7 ) NEW_LINE root . right . right = Node ( 4 ) NEW_LINE check ( root ) NEW_LINE if res : NEW_LINE INDENT print ( " YES " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT DEDENT