<PREV Problem:
NEXT>
Solved by 2561 users: ...
UserDateAttemptTimeCMSC
xtender23 apr 2010Perl1600.0614 
jerom13 may 2007Perl100.0714 
xtender23 apr 2010Perl1200.0615 
uru17 feb 2009Ruby1300.3615 
xtender23 apr 2010Perl1100.0616 
xtender23 apr 2010Perl1300.0616 
Nakilon24 apr 2010Ruby800.0217 
xtender23 apr 2010Perl1000.0618 
uru17 feb 2009Ruby1100.3619 
lacrosse14 apr 2013Ruby600.0320 
lacrosse25 apr 2013Ruby700.0320 
lacrosse25 apr 2013Ruby800.0320 
Asp09 nov 2006Perl500.0620 
sb3ar27 jan 2008Ruby2100.0421 
lacrosse14 apr 2013Ruby500.0322 
Asp08 nov 2006Perl300.0624 
ret08 jan 2010Perl1300.0624 
fetetriste01 may 2009Ruby700.0724 
lacrosse14 apr 2013Ruby400.0225 
evg28110 aug 2006Perl300.0625 
ret08 jan 2010Perl1000.0625 
Languages
C++
1193
FPC
563
C
523
Java
134
Kylix
76
Python
51
Ruby
44
Perl
15
Scheme
8
Haskell
5
Lua
4
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Brackets

Some bracket structures are valid while others are not. Your task is to determine whether a given bracket structure is valid.

Input contains a word of length at most 4000 consisting of symbols ( and ) only.

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

SAMPLE INPUT #1:
()

SAMPLE OUTPUT #1:
YES

SAMPLE INPUT #2:
)(

SAMPLE OUTPUT #2:
NO

SAMPLE INPUT #3:
()(())()

SAMPLE OUTPUT #3:
YES

Athor:

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


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

SW soft NIX
ID = 3.229.142.175