Check sequence of parenthesis