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