import java.util.*; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] a = new int[n]; int[] b = new int[n]; int[] c = new int[100]; for(int i = 0; i < n; i++) { a[i] = in.nextInt(); } int k_score = 0; for(int i = 0; i < n; i++) { b[i] = in.nextInt(); if(b[i] == 0) k_score += a[i]; else c[b[i]-1] += a[i]; } String ans = "YES"; for(int i = 0; i < 100; i++) { if(c[i] > k_score) { ans = "NO"; break; } } System.out.println(ans); } }