import strutils, sequtils, tables, math proc input: auto = stdin.readLine let N = input().parseInt a, b = input().split.map parseInt var left_points = a.sum competitors = initCountTable[int]() for i, b in b: if b != 0: left_points -= a[i] for j in 0 ..< a[i]: competitors.inc(b) for k, v in competitors: if v > left_points: echo "NO" quit() echo "YES"