import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt(), tmp;
		int[] m = new int[101];
		int[] t = new int[n];
		for(int i = 0; i < n; i++){
			t[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++){
			m[sc.nextInt()] += t[i];
		}
		for(int i = 1; i < 101; i++){
			if(m[0] < m[i]){
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
}