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[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } int[] score = new int[200]; 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 < 200; i++) { if (score[i] > sco) { System.out.println("NO"); sc.close(); return; } } System.out.println("YES"); sc.close(); } }