Yandex interview question

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.