HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > C. T. 2011 > problem:


Brackets

Volume problems

• Coin Game
• Cow PinBall
• Cow Sorting
• Colored hills
• Connected components
• Going to the Movies
• Word power
• Word Statistics
• Brackets
• Profits
• Triangle
• Istanbul
• Butterfly
• Buying hay
• Fleas
• Babel tower
• Pizza delivery

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem Description

You are given a sequence of round, square and curly brackets. Determine whether it is correct or not.

Input

There is a sequence of round ('(', ')'), square ('[', ']') and curly ('{', '}') brackets in a single line of input. The length of sequence is between 1 and 255.

Output

Write YES to output if the sequence is correct, and NO otherwise.

Example

input output

([])

YES

(({)}) NO

 

Для отправки решений необходимо выполнить вход.

www.contester.ru