<>;@a=<>=~/\d+/g;$_?$d[$_]:$s+=$a[$i++]for<>=~/\d+/g;print$s<(sort{$b-$a}@d)[0]?"NO":"YES"