<PREV Problem:
NEXT>
Solved by 1864 users: ...
UserDateAttemptTimeCMSC
white_dragon08 jan 2010Perl5200.295 
Kid08 jan 2010Perl9600.305 
pauk199025 sep 2009Kylix2800.108 
pauk199025 sep 2009Kylix3000.108 
pauk199025 sep 2009Kylix3300.108 
pauk199007 dec 2009Kylix3600.108 
white_dragon08 jan 2010Perl4700.2910 
Kid08 jan 2010Perl8500.3011 
white_dragon08 jan 2010Perl2500.2219 
lacrosse25 apr 2013Ruby934.2420 
uru21 feb 2009Ruby1233.4222 
lacrosse14 apr 2013Ruby833.7622 
white_dragon08 jan 2010Perl2100.2124 
Leonid04 sep 2006Perl115.5324 
lacrosse14 apr 2013Ruby533.6825 
lacrosse14 apr 2013Ruby733.6825 
Kid08 jan 2010Perl2300.2426 
Kid08 jan 2010Perl1900.2428 
Kid08 jan 2010Perl2100.2428 
evg28110 aug 2006Perl815.5629 
white_dragon08 jan 2010Perl2000.2130 
Nakilon29 apr 2010Ruby1702.5330 
Nakilon29 apr 2010Ruby1502.4733 
Nakilon08 jan 2010Ruby902.4634 
xtender29 apr 2010Perl2319.5535 
xtender06 oct 2010Perl3817.8337 
ret08 jan 2010Perl1723.9338 
xtender29 apr 2010Perl3700.3039 
xtender29 apr 2010Perl2700.2841 
xtender29 apr 2010Perl3600.2742 
Languages
C++
866
FPC
434
C
359
Java
94
Kylix
60
Ruby
30
Python
29
Perl
14
Haskell
4
Scheme
4
Lua
3
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Multiple Brackets

Time limit: 5 seconds.

Some bracket structures are valid while others are not.
In the valid bracket structure types of opening and closing braces should match.
Your task is to determine whether a given bracket structure is valid.

Input contains a word of length at most 100000 consisting of symbols ()[]{}<> only.

Output should be the single word "YES" or "NO" (without quotes).

SAMPLE INPUT #1:
{)

SAMPLE OUTPUT #1:
NO

SAMPLE INPUT #2:
[({<>})]

SAMPLE OUTPUT #2:
YES

SAMPLE INPUT #3:
><

SAMPLE OUTPUT #3:
NO

Author:
Malykh Anton

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 200ms

SW soft NIX
ID = 34.204.171.214