Write a function that takes a string and tells whether the string is a valid string or not. The string consists of only '[', ']', '{', '}', '(', and ')'. A string is valid only if for every opening bracket/parenthesis there is a matching closing bracket/parenthesis.