import std.stdio, std.conv, std.string, std.range, std.math, std.algorithm, std.bigint; void main() { auto N = readln.strip.to!int; auto a = readln.split.to!(int[]); auto b = readln.split.to!(int[]); int[int] score = [0: 0]; iota(N).array.each!(i => score[b[i]] += a[i]); (score.values.minPos!"a>b".front <= score[0] ? "YES" : "NO").writeln; }