<>;print grep({$i=$j=$s=777;grep{$s-=$b[$j++]+=$_;$s+=$b[$i++]while$s<0;!$s}glob}<>)?YES:NO