If there is only 1 character which does not balances then also it is Yes
else if ( po = = 1 && ne == 0 ) Console . Write ( " YES " + " STRNEWLINE " ) ; else if ( po = = 0 && ne == - 1 ) Console . Write ( " YES " + " STRNEWLINE " ) ; else Console . ( " NO " + " STRNEWLINE " ) ; } }