import java.util.*; public class Exercise76{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] scores = new int[n]; int[] solved = new int[n]; int othersScore = 0; int ksScore = 0; for (int i = 0; i < n; i++){ scores[i] = sc.nextInt(); } for (int i = 0; i < n; i++){ solved[i] = sc.nextInt(); } for (int j = 0; j < n; j++){ if(solved[j] == 0){ ksScore += scores[j]; }else{ othersScore += scores[j]; } } if(ksScore < othersScore){ System.out.println("NO"); }else{ System.out.println("YES"); } } }