import java.util.*;
import java.io.*;

public class Main
{
    public static void main(String args[])
    {
         InputStream in=System.in;
        FastScanner fs=new FastScanner(in);
        PrintWriter out=new PrintWriter(System.out);
        int t=fs.nextInt();
        while(t--!=0)
        {
         int n=fs.nextInt();
        int arr[]=new int[n];
        for(int i=0;i<n;i++)
        {
        arr[i]=fs.nextInt();
        }
    }
    }
   static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream f) {
            try {
                br = new BufferedReader(new InputStreamReader(f));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

    }

}


import java.io.*;
import java.util.*;
public class JavaApplication1 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long volume[] = new long[n];
        long capacity[] = new long[n];
        long sumv=0,sumc;
        for(int i=0;i<(long)n;i++)
        {
            volume[i] = sc.nextLong();
            sumv+=volume[i];
        }
        for(int i=0;i<n;i++)
        {
            capacity[i] = sc.nextLong();
        }
        Arrays.sort(capacity);
        sumc=capacity[capacity.length-1]+capacity[capacity.length-2];
        if(sumc>=sumv)
            System.out.print("YES");
        else System.out.print("NO");
    }

}


import java.io.*;
import java.util.*;

public class JavaApplication1 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long volume[] = new long[n];
        long capacity[] = new long[n];
        long sumv=0,sumc;
        for(int i=0;i<(long)n;i++)
        {
            volume[i] = sc.nextLong();
            sumv+=volume[i];
        }
        for(int i=0;i<n;i++)
        {
            capacity[i] = sc.nextLong();
        }
        Arrays.sort(capacity);
        sumc=capacity[capacity.length-1]+capacity[capacity.length-2];
        if(sumc>=sumv)
            System.out.print("YES");
        else System.out.print("NO");
    }
}


import java.io.*;
import java.util.*;

public class JavaApplication1 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int volume[] = new int[n];
        int capacity[] = new int[n];
        int sumv=0,sumc=0;
        for(int i=0;i<n;i++)
        {
            volume[i] = sc.nextInt();
            sumv+=volume[i];
        }
        for(int i=0;i<n;i++)
        {
            capacity[i] = sc.nextInt();
        }
        Arrays.sort(capacity);
        sumc=capacity[capacity.length-1]+capacity[capacity.length-2];
        if(sumc>=sumv)
            System.out.print("YES");
        else System.out.print("NO");
    }

}


import java.io.*;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {
	public static void main(String[] args) throws FileNotFoundException {
		int toFile = 0;
		InputStream inputStream;
		OutputStream outputStream;
		if (toFile == 0) {
			inputStream = System.in;
			outputStream = System.out;
		} else {
			inputStream = new FileInputStream(new File("A.in"));
			outputStream = new FileOutputStream(new File("A.out"));
		}
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}

	static class TaskA {

		public void solve(InputReader in, PrintWriter out) {
			int n = in.nextInt();
			int a[] = new int[n];
			int b[] = new int[n];
			int c[] = new int[n];

			for (int i=0; i<n; i++)
				a[i] = in.nextInt();
			for (int i=0; i<n; i++) {
				b[i] = in.nextInt();
				c[i] = b[i];
			}

			Arrays.sort(c);

			int max1, max2, a1, a2;
			max1 = max2 = a1 = a2 = -1;

			if (c[n - 1] != c[n - 2]) {
				for (int i=0; i<n; i++) {
					if (c[n - 1] == b[i]) {
						max1 = b[i];
						a1 = i;
					}
					if (c[n - 2] == b[i]) {
						max2 = b[i];
						a2 = i;
					}
				}
			} else {
				for (int i=0; i<n; i++) {
					if (c[n - 1] == b[i]) {
						if (max1 == -1) {
							max1 = b[i];
							a1 = i;
						}
						else {
							max2 = b[i];
							a2 = i;
						}
					}
				}
			}

			int sum = 0;
			for (int i=0; i<n; i++) {
				if (i != a1 && i != a2)
					sum += a[i];
			}
			if (sum > b[a1] - a[a1] + b[a2] - a[a2])
				out.print("NO");
			else
				out.print("YES");
		}

	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {
	public static void main(String[] args) throws FileNotFoundException {
		int toFile = 0;
		InputStream inputStream;
		OutputStream outputStream;
		if (toFile == 0) {
			inputStream = System.in;
			outputStream = System.out;
		} else {
			inputStream = new FileInputStream(new File("A.in"));
			outputStream = new FileOutputStream(new File("A.out"));
		}
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}

	static class TaskA {

		public void solve(InputReader in, PrintWriter out) {
			int n = in.nextInt();
			long a[] = new long[n];
			long b[] = new long[n];
			long c[] = new long[n];

			for (int i=0; i<n; i++)
				a[i] = in.nextInt();

			for (int i=0; i<n; i++) {
				b[i] = in.nextInt();
				c[i] = b[i];
			}

			Arrays.sort(c);

			long sum = 0;
			for (int i=0; i<n; i++)
				sum += a[i];

			if (sum > c[n - 1] + c[n - 2])
				out.print("NO");
			else
				out.print("YES");
		}

	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
}


import java.io.*;
import java.util.StringTokenizer;

public class A {
	public static void main(String[] args) throws FileNotFoundException {
		int toFile = 0;
		InputStream inputStream;
		OutputStream outputStream;
		if (toFile == 0) {
			inputStream = System.in;
			outputStream = System.out;
		} else {
			inputStream = new FileInputStream(new File("A.in"));
			outputStream = new FileOutputStream(new File("A.out"));
		}
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}

	static class TaskA {

		public void solve(InputReader in, PrintWriter out) {
			int n = in.nextInt();
			int a[] = new int[n];
			int b[] = new int[n];

			for (int i=0; i<n; i++)
				a[i] = in.nextInt();
			for (int i=0; i<n; i++)
				b[i] = in.nextInt();

			int max1, max2;
			max1 = -1;
			max2 = -1;
			int a1, a2;
			a1 = -1;
			a2 = -1;
			for (int i=0; i<n; i++)
				if (max1 < b[i]) {
					max2 = max1;
					max1 = b[i];
					a2 = a1;
					a1 = i;
				}
				else if (max2 < b[i]) {
					max2 = b[i];
					a2 = i;
				}

			int sum = 0;
			for (int i=0; i<n; i++) {
				if (i != a1 && i != a2)
					sum += a[i];
			}
			if (sum > b[a1] - a[a1] + b[a2] - a[a2])
				out.print("NO");
			else
				out.print("YES");
		}

	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {
	public static void main(String[] args) throws FileNotFoundException {
		int toFile = 0;
		InputStream inputStream;
		OutputStream outputStream;
		if (toFile == 0) {
			inputStream = System.in;
			outputStream = System.out;
		} else {
			inputStream = new FileInputStream(new File("A.in"));
			outputStream = new FileOutputStream(new File("A.out"));
		}
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}

	static class TaskA {

		public void solve(InputReader in, PrintWriter out) {
			int n = in.nextInt();
			int a[] = new int[n];
			int b[] = new int[n];
			int c[] = new int[n];

			for (int i=0; i<n; i++)
				a[i] = in.nextInt();

			for (int i=0; i<n; i++) {
				b[i] = in.nextInt();
				c[i] = b[i];
			}

			Arrays.sort(c);

			int sum = 0;
			for (int i=0; i<n; i++)
				sum += a[i];

			if (sum > c[n - 1] + c[n - 2])
				out.print("NO");
			else
				out.print("YES");
		}

	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
}


import java.util.Scanner;

public class ProblemA_Alchnost {
    private static int[] a;
    private static int[] b;
    private static int max, secondMax;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();

        int summA = 0;
        for (int i = 0; i < n; i++) {
            summA += scanner.nextInt();
        }
        scanner.nextLine();
        max = scanner.nextInt();
        secondMax = scanner.nextInt();
        int temp = Math.max(max, secondMax);
        secondMax = max;
        max = temp;

        for (int i = 2; i < n; i++) {
            temp = scanner.nextInt();
            if (temp > secondMax){
                if (temp > max){
                    secondMax = max;
                    max = temp;
                }
                secondMax = temp;
            }
        }

        if (n == 2){
            System.out.println("YES");
            return;
        }

        if (summA - max - secondMax != 0){
            System.out.println("NO");
        } else {
            System.out.println("YES");
        }
    }
}


import java.util.Scanner;

public class ProblemA_Alchnost {
    private static int[] a;
    private static int[] b;
    private static int max, secondMax;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();

        long summA = 0;
        for (int i = 0; i < n; i++) {
            summA += scanner.nextInt();
        }
        scanner.nextLine();
        max = scanner.nextInt();
        secondMax = scanner.nextInt();
        int temp = Math.max(max, secondMax);
        secondMax = max;
        max = temp;

        for (int i = 2; i < n; i++) {
            temp = scanner.nextInt();
            if (temp > max){
                secondMax = max;
                max = temp;
                continue;
            }
            if (temp > secondMax){
                secondMax = temp;
            }
        }

        if (n == 2){
            System.out.println("YES");
            return;
        }

        if (summA - max - secondMax <= 0){
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


import java.util.Scanner;

public class ProblemA_Alchnost {
    private static int[] a;
    private static int[] b;
    private static int max, secondMax;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();

        int summA = 0;
        for (int i = 0; i < n; i++) {
            summA += scanner.nextInt();
        }
        scanner.nextLine();
        max = scanner.nextInt();
        secondMax = scanner.nextInt();
        int temp = Math.max(max, secondMax);
        secondMax = max;
        max = temp;

        for (int i = 2; i < n; i++) {
            temp = scanner.nextInt();
            if (temp > secondMax){
                if (temp > max){
                    secondMax = max;
                    max = temp;
                }
                secondMax = temp;
            }
        }

        if (n == 2){
            System.out.println("YES");
            return;
        }

        if (summA - max - secondMax <= 0){
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


import java.util.Scanner;

public class ProblemA_Alchnost {
    private static int[] a;
    private static int[] b;
    private static int max, secondMax;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();

        long summA = 0;
        for (int i = 0; i < n; i++) {
            summA += scanner.nextInt();
        }
        scanner.nextLine();
        max = scanner.nextInt();
        secondMax = scanner.nextInt();
        int temp = Math.max(max, secondMax);
        secondMax = max;
        max = temp;

        for (int i = 2; i < n; i++) {
            temp = scanner.nextInt();
            if (temp > max){
                secondMax = max;
                max = temp;
                continue;
            }
            if (temp > secondMax){
                secondMax = temp;
            }
        }

        if (n == 2){
            System.out.println("YES");
            return;
        }

//        if (summA == 0){
//            System.out.println("NO");
//            return;
//        }

        if (max + secondMax >= summA){
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


import java.util.Scanner;

public class ProblemA_Alchnost {
    private static int[] a;
    private static int[] b;
    private static int max, secondMax;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();

        int summA = 0;
        for (int i = 0; i < n; i++) {
            summA += scanner.nextInt();
        }
        scanner.nextLine();
        max = scanner.nextInt();
        secondMax = scanner.nextInt();
        int temp = Math.max(max, secondMax);
        secondMax = max;
        max = temp;

        for (int i = 2; i < n; i++) {
            temp = scanner.nextInt();
            if (temp > max){
                secondMax = max;
                max = temp;
                continue;
            }
            if (temp > secondMax){
                secondMax = temp;
            }
        }

        if (n == 2){
            System.out.println("YES");
            return;
        }

        if (summA - max - secondMax <= 0){
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


import java.util.Scanner;

public class ProblemA_Alchnost {
    private static int[] a;
    private static int[] b;
    private static int max, secondMax;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();

        long summA = 0;
        for (int i = 0; i < n; i++) {
            summA += scanner.nextInt();
        }
        scanner.nextLine();
        max = scanner.nextInt();
        secondMax = scanner.nextInt();
        int temp = Math.max(max, secondMax);
        secondMax = max;
        max = temp;

        for (int i = 2; i < n; i++) {
            temp = scanner.nextInt();
            if (temp > max){
                secondMax = max;
                max = temp;
                continue;
            }
            if (temp > secondMax){
                secondMax = temp;
            }
        }

        if (n == 2){
            System.out.println("YES");
            return;
        }

        if (summA == 0){
            System.out.println("NO");
            return;
        }

        if (summA - max - secondMax <= 0){
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


import java.util.*;

/**
 *
 * @author Anjali
 */
public class Can {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int ar[]= new int[n];
        int ar1[]= new int[n];
        int tot=0;
        for(int i=0;i<n;i++)
        {
            ar[i]=in.nextInt();
            tot+= ar[i];
        }
        for(int i=0;i<n;i++)
        {
            ar1[i] = in.nextInt();
        }
        Arrays.sort(ar1);
        if(ar1[n-1]+ar1[n-2]>=tot)
              System.out.println("YES");
        else
            System.out.println("NO");
    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;
import java.util.Arrays;
/**
 *
 * @author Anjali
 */
public class Greedy {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        int n= in.nextInt();
        int ar[]= new int[n];
        int br[]= new int[n];
        int cap[]= new int[n];
        int sum=0;
        for(int i=0;i<n;i++)
        {
            ar[i]= in.nextInt();
            sum+=ar[i];
        }
        for(int i=0;i<n;i++)
        {
            br[i]=in.nextInt();
        }
        Arrays.sort(br);
        for(int i=n-1;i>=0;i--)
        {
            cap[i]=br[i];
        }
        for(int i=0;i<n-1;i++)
        {
          if(sum<=cap[i]+cap[i+1])
          {
               System.out.println("YES");
               return;
          }

        }
        System.out.println("NO");

    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.util.Scanner;
import java.util.Arrays;
/**
 *
 * @author Anjali
 */
public class Greedy {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        int n= in.nextInt();
        int ar[]= new int[n];
        int br[]= new int[n];
        int cap[]= new int[n];
        int sum=0;
        for(int i=0;i<n;i++)
        {
            ar[i]= in.nextInt();
            sum+=ar[i];
        }
        for(int i=0;i<n;i++)
        {
            br[i]=in.nextInt();
        }
        Arrays.sort(br);
        for(int i=n-1;i>=0;i--)
        {
            cap[i]=br[i];
        }
        for(int i=0;i<n-1;i++)
        {
          if(sum<=cap[i]+cap[i+1])
          {
               System.out.println("YES");
               return;
          }
          else
          {
              System.out.println("NO");
              return;
          }

        }

    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;
import java.util.Arrays;
/**
 *
 * @author Anjali
 */
public class Greedy {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        int n= in.nextInt();
        long ar[]= new long[n];
        long br[]= new long[n];

        long sum=0;
        for(int i=0;i<n;i++)
        {
            ar[i]= in.nextInt();
            sum+=ar[i];
        }
        for(int i=0;i<n;i++)
        {
            br[i]=in.nextInt();
        }
        Arrays.sort(br);
        if(br[n-1]+br[n-2]>=sum)
            System.out.println("YES");
        else
            System.out.println("NO");

    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.Scanner;
import java.util.Arrays;
/**
 *
 * @author Anjali
 */
public class Greedy {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        int n= in.nextInt();
        int ar[]= new int[n];
        int br[]= new int[n];

        int sum=0;
        for(int i=0;i<n;i++)
        {
            ar[i]= in.nextInt();
            sum+=ar[i];
        }
        for(int i=0;i<n;i++)
        {
            br[i]=in.nextInt();
        }
        Arrays.sort(br);
        if(br[n-1]+br[n-2]>=sum)
            System.out.println("YES");
        else
            System.out.println("NO");

    }

}


import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Arrays;

public class A {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Solver solver = new Solver(br, bw);
        solver.solve(br, bw);
        br.close();
        bw.close();
    }

    static class Solver {

        IO io;
        Utils utils;

        Solver(BufferedReader br, BufferedWriter bw) {
            io = new IO(br, bw);
//            utils = new Utils();
        }

        void solve(BufferedReader br, BufferedWriter bw) throws IOException {
            int n = io.getInt();
            int[] vol = io.getIntArray();
            int[] cap = io.getIntArray();

            long tvol = 0L;
            for (int i = 0; i < n; i++) {
                   tvol+=vol[i];
            }

            Arrays.sort(cap);
            long tcap = cap[n-1]+cap[n-2];

            if (tcap > tvol)
                io.print("YES");
            else
                io.print("NO");
        }

    }

    static class IO {

        BufferedReader br;
        BufferedWriter bw;

        IO(BufferedReader br, BufferedWriter bw) {
            this.br = br;
            this.bw = bw;
        }

        String[] getStringArray() throws IOException {
            return getStringArray(" ");
        }

        String[] getStringArray(String regex) throws IOException {
            return br.readLine().split(regex);
        }

        long[] getLongArray() throws IOException {
            return getLongArray(" ");
        }

        long[] getLongArray(String regex) throws IOException {
            String[] temp = getStringArray(regex);
            long[] a = new long[temp.length];
            for (int i = 0; i < temp.length; i++) {
                a[i] = getLong(temp[i]);
            }
            return a;
        }

        int[] getIntArray() throws IOException {
            return getIntArray(" ");
        }

        int[] getIntArray(String regex) throws IOException {
            String[] temp = getStringArray(regex);
            int[] a = new int[temp.length];
            for (int i = 0; i < temp.length; i++) {
                a[i] = getInt(temp[i]);
            }
            return a;
        }

        String getString() throws IOException {
            return br.readLine();
        }

        int getInt() throws IOException {
            return getInt(br.readLine());
        }

        long getLong() throws IOException {
            return getLong(br.readLine());
        }

        int getInt(String s) {
            return Integer.parseInt(s);
        }

        long getLong(String s) {
            return Long.parseLong(s);
        }

        void print(int x) throws IOException {
            bw.write(x + "");
        }

        void print(long x) throws IOException {
            bw.write(x + "");
        }

        void print(String x) throws IOException {
            bw.write(x + "");
        }

        void println(int x) throws IOException {
            bw.write(x + "\n");
        }

        void println(long x) throws IOException {
            bw.write(x + "\n");
        }

        void println(String x) throws IOException {
            bw.write(x + "\n");
        }

        void printArray(int[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(long[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(float[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(double[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void print2DArray(int[][] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    bw.write(a[i] + " ");
                }
                bw.write("\n");
            }
            bw.write("\n");
        }

        void print2DArray(long[][] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    bw.write(a[i][j] + " ");
                }
                bw.write("\n");
            }
            bw.write("\n");
        }

    }

    static class Utils {

        Pair<Integer, Integer> minMax(int[] a) {
            int len = a.length;
            if (len < 1) {
                return null;
            } else if (len == 1) {
                new Pair<>(a[0], a[0]);
            }

            int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;

            for (int i = 0; i < len; i++) {
                int elem = a[i], next = elem;

                if (i != len - 1) {
                    next = a[i + 1];
                }

                if (elem <= next) {
                    int temp = elem;
                    elem = next;
                    next = temp;
                }

                if (elem > max) {
                    max = elem;
                }

                if (next < min) {
                    min = next;
                }
            }
            return new Pair<>(max, min);
        }

        void factorize(int n, int[] factors) {
            for (int i = 2; i <= n; i = (i == 2) ? i + 1 : i + 2) {
                if (isPrime(i) && n % i == 0) {
                    int ct = 1;
                    int temp = n / i;
                    while (temp % i == 0) {
                        temp = temp / i;
                        ct++;
                    }
                    factors[i] = ct;
                }
            }
        }

        boolean isPrime(long n) {
            // fast even test.
            if (n > 2 && (n & 1) == 0)
                return false;

            // only odd factors need to be tested up to n^0.5
            for (int i = 3; i * i <= n; i += 2)
                if (n % i == 0)
                    return false;
            return true;
        }
    }

    static class Pair<A, B> {
        A a;
        B b;

        Pair(A a, B b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "a=" + a +
                    ", b=" + b +
                    '}';
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author yashk
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            int vol[] = in.nextIntArray(n);
            int cap[] = in.nextIntArray(n);

            long tvol = 0;
            for (int i = 0; i < n; i++) {
                tvol += vol[i];
            }

            Arrays.sort(cap);
            long tcap = cap[n - 1] + cap[n - 2];
            if (tcap >= tvol)
                out.print("YES");
            else
                out.print("NO");
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int[] nextIntArray(int n) {
            int[] array = new int[n];
            for (int i = 0; i < n; ++i) array[i] = nextInt();
            return array;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void close() {
            writer.close();
        }

    }
}


import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Arrays;

public class A {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Solver solver = new Solver(br, bw);
        solver.solve(br, bw);
        br.close();
        bw.close();
    }

    static class Solver {

        IO io;
        Utils utils;

        Solver(BufferedReader br, BufferedWriter bw) {
            io = new IO(br, bw);
//            utils = new Utils();
        }

        void solve(BufferedReader br, BufferedWriter bw) throws IOException {
            int n = io.getInt();
            int[] vol = io.getIntArray();
            int[] cap = io.getIntArray();

            long tvol = 0L;
            for (int i = 0; i < n; i++) {
                   tvol+=vol[i];
            }

            Arrays.sort(cap);
            long tcap = cap[n-1]+cap[n-2];

            if (tcap >= tvol)
                io.print("YES");
            else
                io.print("NO");
        }

    }

    static class IO {

        BufferedReader br;
        BufferedWriter bw;

        IO(BufferedReader br, BufferedWriter bw) {
            this.br = br;
            this.bw = bw;
        }

        String[] getStringArray() throws IOException {
            return getStringArray(" ");
        }

        String[] getStringArray(String regex) throws IOException {
            return br.readLine().split(regex);
        }

        long[] getLongArray() throws IOException {
            return getLongArray(" ");
        }

        long[] getLongArray(String regex) throws IOException {
            String[] temp = getStringArray(regex);
            long[] a = new long[temp.length];
            for (int i = 0; i < temp.length; i++) {
                a[i] = getLong(temp[i]);
            }
            return a;
        }

        int[] getIntArray() throws IOException {
            return getIntArray(" ");
        }

        int[] getIntArray(String regex) throws IOException {
            String[] temp = getStringArray(regex);
            int[] a = new int[temp.length];
            for (int i = 0; i < temp.length; i++) {
                a[i] = getInt(temp[i]);
            }
            return a;
        }

        String getString() throws IOException {
            return br.readLine();
        }

        int getInt() throws IOException {
            return getInt(br.readLine());
        }

        long getLong() throws IOException {
            return getLong(br.readLine());
        }

        int getInt(String s) {
            return Integer.parseInt(s);
        }

        long getLong(String s) {
            return Long.parseLong(s);
        }

        void print(int x) throws IOException {
            bw.write(x + "");
        }

        void print(long x) throws IOException {
            bw.write(x + "");
        }

        void print(String x) throws IOException {
            bw.write(x + "");
        }

        void println(int x) throws IOException {
            bw.write(x + "\n");
        }

        void println(long x) throws IOException {
            bw.write(x + "\n");
        }

        void println(String x) throws IOException {
            bw.write(x + "\n");
        }

        void printArray(int[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(long[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(float[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(double[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void print2DArray(int[][] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    bw.write(a[i] + " ");
                }
                bw.write("\n");
            }
            bw.write("\n");
        }

        void print2DArray(long[][] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    bw.write(a[i][j] + " ");
                }
                bw.write("\n");
            }
            bw.write("\n");
        }

    }

    static class Utils {

        Pair<Integer, Integer> minMax(int[] a) {
            int len = a.length;
            if (len < 1) {
                return null;
            } else if (len == 1) {
                new Pair<>(a[0], a[0]);
            }

            int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;

            for (int i = 0; i < len; i++) {
                int elem = a[i], next = elem;

                if (i != len - 1) {
                    next = a[i + 1];
                }

                if (elem <= next) {
                    int temp = elem;
                    elem = next;
                    next = temp;
                }

                if (elem > max) {
                    max = elem;
                }

                if (next < min) {
                    min = next;
                }
            }
            return new Pair<>(max, min);
        }

        void factorize(int n, int[] factors) {
            for (int i = 2; i <= n; i = (i == 2) ? i + 1 : i + 2) {
                if (isPrime(i) && n % i == 0) {
                    int ct = 1;
                    int temp = n / i;
                    while (temp % i == 0) {
                        temp = temp / i;
                        ct++;
                    }
                    factors[i] = ct;
                }
            }
        }

        boolean isPrime(long n) {
            // fast even test.
            if (n > 2 && (n & 1) == 0)
                return false;

            // only odd factors need to be tested up to n^0.5
            for (int i = 3; i * i <= n; i += 2)
                if (n % i == 0)
                    return false;
            return true;
        }
    }

    static class Pair<A, B> {
        A a;
        B b;

        Pair(A a, B b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "a=" + a +
                    ", b=" + b +
                    '}';
        }
    }
}


import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Arrays;

public class A {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Solver solver = new Solver(br, bw);
        solver.solve(br, bw);
        br.close();
        bw.close();
    }

    static class Solver {

        IO io;
        Utils utils;

        Solver(BufferedReader br, BufferedWriter bw) {
            io = new IO(br, bw);
//            utils = new Utils();
        }

        void solve(BufferedReader br, BufferedWriter bw) throws IOException {
            int n = io.getInt();
            int[] vol = io.getIntArray();
            int[] cap = io.getIntArray();

            long tvol = 0L;
            for (int i = 0; i < n; i++) {
                tvol += vol[i];
            }

            for (int i = 0; i < n; i++) {
                cap[i] -= vol[i];
            }
            Arrays.sort(cap);
            long tcap = cap[n-1]+cap[n-2];

            if (tcap > tvol)
                io.print("YES");
            else
                io.print("NO");
        }

    }

    static class IO {

        BufferedReader br;
        BufferedWriter bw;

        IO(BufferedReader br, BufferedWriter bw) {
            this.br = br;
            this.bw = bw;
        }

        String[] getStringArray() throws IOException {
            return getStringArray(" ");
        }

        String[] getStringArray(String regex) throws IOException {
            return br.readLine().split(regex);
        }

        long[] getLongArray() throws IOException {
            return getLongArray(" ");
        }

        long[] getLongArray(String regex) throws IOException {
            String[] temp = getStringArray(regex);
            long[] a = new long[temp.length];
            for (int i = 0; i < temp.length; i++) {
                a[i] = getLong(temp[i]);
            }
            return a;
        }

        int[] getIntArray() throws IOException {
            return getIntArray(" ");
        }

        int[] getIntArray(String regex) throws IOException {
            String[] temp = getStringArray(regex);
            int[] a = new int[temp.length];
            for (int i = 0; i < temp.length; i++) {
                a[i] = getInt(temp[i]);
            }
            return a;
        }

        String getString() throws IOException {
            return br.readLine();
        }

        int getInt() throws IOException {
            return getInt(br.readLine());
        }

        long getLong() throws IOException {
            return getLong(br.readLine());
        }

        int getInt(String s) {
            return Integer.parseInt(s);
        }

        long getLong(String s) {
            return Long.parseLong(s);
        }

        void print(int x) throws IOException {
            bw.write(x + "");
        }

        void print(long x) throws IOException {
            bw.write(x + "");
        }

        void print(String x) throws IOException {
            bw.write(x + "");
        }

        void println(int x) throws IOException {
            bw.write(x + "\n");
        }

        void println(long x) throws IOException {
            bw.write(x + "\n");
        }

        void println(String x) throws IOException {
            bw.write(x + "\n");
        }

        void printArray(int[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(long[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(float[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(double[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void print2DArray(int[][] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    bw.write(a[i] + " ");
                }
                bw.write("\n");
            }
            bw.write("\n");
        }

        void print2DArray(long[][] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    bw.write(a[i][j] + " ");
                }
                bw.write("\n");
            }
            bw.write("\n");
        }

    }

    static class Utils {

        Pair<Integer, Integer> minMax(int[] a) {
            int len = a.length;
            if (len < 1) {
                return null;
            } else if (len == 1) {
                new Pair<>(a[0], a[0]);
            }

            int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;

            for (int i = 0; i < len; i++) {
                int elem = a[i], next = elem;

                if (i != len - 1) {
                    next = a[i + 1];
                }

                if (elem <= next) {
                    int temp = elem;
                    elem = next;
                    next = temp;
                }

                if (elem > max) {
                    max = elem;
                }

                if (next < min) {
                    min = next;
                }
            }
            return new Pair<>(max, min);
        }

        void factorize(int n, int[] factors) {
            for (int i = 2; i <= n; i = (i == 2) ? i + 1 : i + 2) {
                if (isPrime(i) && n % i == 0) {
                    int ct = 1;
                    int temp = n / i;
                    while (temp % i == 0) {
                        temp = temp / i;
                        ct++;
                    }
                    factors[i] = ct;
                }
            }
        }

        boolean isPrime(long n) {
            // fast even test.
            if (n > 2 && (n & 1) == 0)
                return false;

            // only odd factors need to be tested up to n^0.5
            for (int i = 3; i * i <= n; i += 2)
                if (n % i == 0)
                    return false;
            return true;
        }
    }

    static class Pair<A, B> {
        A a;
        B b;

        Pair(A a, B b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "a=" + a +
                    ", b=" + b +
                    '}';
        }
    }
}


import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Arrays;

public class A {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Solver solver = new Solver(br, bw);
        solver.solve(br, bw);
        br.close();
        bw.close();
    }

    static class Solver {

        IO io;
        Utils utils;

        Solver(BufferedReader br, BufferedWriter bw) {
            io = new IO(br, bw);
//            utils = new Utils();
        }

        void solve(BufferedReader br, BufferedWriter bw) throws IOException {
            int n = io.getInt();
            int[] vol = io.getIntArray();
            int[] cap = io.getIntArray();

            long tvol = 0L;
            for (int i = 0; i < n; i++) {
                tvol += vol[i];
            }

            boolean ans = false;
            for (int i = 0; i < n - 1; i++) {
                for (int j = i + 1; j < n; j++) {
                    long x = cap[i] + cap[j] - vol[i] - vol[j];
                    long y = tvol - vol[i] - vol[j];
                    if (x >= y) {
                        ans = true;
                    }
                }
            }
            if (ans)
                io.print("YES");
            else
                io.print("NO");
        }

    }

    static class IO {

        BufferedReader br;
        BufferedWriter bw;

        IO(BufferedReader br, BufferedWriter bw) {
            this.br = br;
            this.bw = bw;
        }

        String[] getStringArray() throws IOException {
            return getStringArray(" ");
        }

        String[] getStringArray(String regex) throws IOException {
            return br.readLine().split(regex);
        }

        long[] getLongArray() throws IOException {
            return getLongArray(" ");
        }

        long[] getLongArray(String regex) throws IOException {
            String[] temp = getStringArray(regex);
            long[] a = new long[temp.length];
            for (int i = 0; i < temp.length; i++) {
                a[i] = getLong(temp[i]);
            }
            return a;
        }

        int[] getIntArray() throws IOException {
            return getIntArray(" ");
        }

        int[] getIntArray(String regex) throws IOException {
            String[] temp = getStringArray(regex);
            int[] a = new int[temp.length];
            for (int i = 0; i < temp.length; i++) {
                a[i] = getInt(temp[i]);
            }
            return a;
        }

        String getString() throws IOException {
            return br.readLine();
        }

        int getInt() throws IOException {
            return getInt(br.readLine());
        }

        long getLong() throws IOException {
            return getLong(br.readLine());
        }

        int getInt(String s) {
            return Integer.parseInt(s);
        }

        long getLong(String s) {
            return Long.parseLong(s);
        }

        void print(int x) throws IOException {
            bw.write(x + "");
        }

        void print(long x) throws IOException {
            bw.write(x + "");
        }

        void print(String x) throws IOException {
            bw.write(x + "");
        }

        void println(int x) throws IOException {
            bw.write(x + "\n");
        }

        void println(long x) throws IOException {
            bw.write(x + "\n");
        }

        void println(String x) throws IOException {
            bw.write(x + "\n");
        }

        void printArray(int[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(long[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(float[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void printArray(double[] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                bw.write(a[i] + " ");
            }
            bw.write("\n");
        }

        void print2DArray(int[][] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    bw.write(a[i] + " ");
                }
                bw.write("\n");
            }
            bw.write("\n");
        }

        void print2DArray(long[][] a) throws IOException {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    bw.write(a[i][j] + " ");
                }
                bw.write("\n");
            }
            bw.write("\n");
        }

    }

    static class Utils {

        Pair<Integer, Integer> minMax(int[] a) {
            int len = a.length;
            if (len < 1) {
                return null;
            } else if (len == 1) {
                new Pair<>(a[0], a[0]);
            }

            int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;

            for (int i = 0; i < len; i++) {
                int elem = a[i], next = elem;

                if (i != len - 1) {
                    next = a[i + 1];
                }

                if (elem <= next) {
                    int temp = elem;
                    elem = next;
                    next = temp;
                }

                if (elem > max) {
                    max = elem;
                }

                if (next < min) {
                    min = next;
                }
            }
            return new Pair<>(max, min);
        }

        void factorize(int n, int[] factors) {
            for (int i = 2; i <= n; i = (i == 2) ? i + 1 : i + 2) {
                if (isPrime(i) && n % i == 0) {
                    int ct = 1;
                    int temp = n / i;
                    while (temp % i == 0) {
                        temp = temp / i;
                        ct++;
                    }
                    factors[i] = ct;
                }
            }
        }

        boolean isPrime(long n) {
            // fast even test.
            if (n > 2 && (n & 1) == 0)
                return false;

            // only odd factors need to be tested up to n^0.5
            for (int i = 3; i * i <= n; i += 2)
                if (n % i == 0)
                    return false;
            return true;
        }
    }

    static class Pair<A, B> {
        A a;
        B b;

        Pair(A a, B b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "a=" + a +
                    ", b=" + b +
                    '}';
        }
    }
}


import java.util.Scanner;
import java.util.Arrays;

public class Greed{
    public static void main(String []args){
        //For Storing Problem Data.
        int canCount = Console.nextInt();
        long [] colaVolume   = new long [canCount];
        long [] colaCapacity = new long [canCount];
        //Getting Cola for each Can.
        int totalColaVolume = 0;
        for(int x = 0;x<canCount;++x){
            totalColaVolume+= (colaVolume[x] = Console.nextLong());
        }
        //Getting Total Capacity for each Can.
        for (int x = 0;x<canCount;++x){
            colaCapacity[x] = Console.nextLong();
        }
        //Sorting to find Cans with Highest Capacity.
        Arrays.sort(colaCapacity);
        long maxTwoCanCapacity = colaCapacity[canCount-1]+
        colaCapacity[canCount-2];
        //Verdict.
        if(maxTwoCanCapacity>= totalColaVolume){
            System.out.println("YES");
        }
        else System.out.println("NO");
    }
    public static final Scanner Console = new Scanner(System.in);
}


import java.util.Scanner;
import java.util.Arrays;

public class Greed{
    public static void main(String []args){
        //For Storing Problem Data.
        int canCount = Console.nextInt();
        int [] colaVolume   = new int [canCount];
        int [] colaCapacity = new int [canCount];
        //Getting Cola for each Can.
        int totalColaVolume = 0;
        for(int x = 0;x<canCount;++x){
            totalColaVolume+= (colaVolume[x] = Console.nextInt());
        }
        //Getting Total Capacity for each Can.
        for (int x = 0;x<canCount;++x){
            colaCapacity[x] = Console.nextInt();
        }
        //Sorting to find Cans with Highest Capacity.
        Arrays.sort(colaCapacity);
        int maxTwoCanCapacity = colaCapacity[canCount-1]+
        colaCapacity[canCount-2];
        //Verdict.
        if(maxTwoCanCapacity>= totalColaVolume){
            System.out.println("YES");
        }
        else System.out.println("NO");
    }
    public static final Scanner Console = new Scanner(System.in);
}


import java.util.Scanner;
import java.math.BigInteger;
import java.util.Arrays;

public class Greed{
    public static void main(String []args){
        //For Storing Problem Data.
        int canCount = Console.nextInt();
        BigInteger [] colaVolume   = new BigInteger [canCount];
        BigInteger [] colaCapacity = new BigInteger [canCount];
        //Getting Cola for each Can.
        BigInteger totalColaVolume = new BigInteger("0");
        for(int x = 0;x<canCount;++x){
            totalColaVolume = totalColaVolume.add(colaVolume[x] = Console.nextBigInteger());
        }
        //Getting Total Capacity for each Can.
        for (int x = 0;x<canCount;++x){
            colaCapacity[x] = Console.nextBigInteger();
        }
        //Sorting to find Cans with Highest Capacity.
        Arrays.sort(colaCapacity);
        BigInteger maxTwoCanCapacity = colaCapacity[canCount-1].add(colaCapacity[canCount-2]);
        //Verdict.
        if(maxTwoCanCapacity.compareTo(totalColaVolume)>=0){
            System.out.println("YES");
        }
        else System.out.println("NO");
    }
    public static final Scanner Console = new Scanner(System.in);
}


import java.util.Scanner;
import java.math.BigInteger;
import java.util.Arrays;

public class Greed{
    public static void main(String []args){
        //For Storing Problem Data.
        int canCount = Console.nextInt();
        BigInteger [] colaVolume   = new BigInteger [canCount];
        BigInteger [] colaCapacity = new BigInteger [canCount];
        //Getting Cola for each Can.
        BigInteger totalColaVolume = new BigInteger("0");
        for(int x = 0;x<canCount;++x){
            totalColaVolume.add(colaVolume[x] = Console.nextBigInteger());
        }
        //Getting Total Capacity for each Can.
        for (int x = 0;x<canCount;++x){
            colaCapacity[x] = Console.nextBigInteger();
        }
        //Sorting to find Cans with Highest Capacity.
        Arrays.sort(colaCapacity);
        BigInteger maxTwoCanCapacity = colaCapacity[canCount-1].add(
        colaCapacity[canCount-2]);
        //Verdict.
        if(maxTwoCanCapacity.compareTo(totalColaVolume)>=0){
            System.out.println("YES");
        }
        else System.out.println("NO");
    }
    public static final Scanner Console = new Scanner(System.in);
}


import java.util.Scanner;
import java.math.BigInteger;
import java.util.Arrays;

public class Greed{
    public static void main(String []args){
        //For Storing Problem Data.
        int canCount = Console.nextInt();
        BigInteger [] colaVolume   = new BigInteger [canCount];
        BigInteger [] colaCapacity = new BigInteger [canCount];
        //Getting Cola for each Can.
        int totalColaVolume = 0;
        for(int x = 0;x<canCount;++x){
            totalColaVolume+= (colaVolume[x] = Console.nextBigInteger());
        }
        //Getting Total Capacity for each Can.
        for (int x = 0;x<canCount;++x){
            colaCapacity[x] = Console.nextBigInteger();
        }
        //Sorting to find Cans with Highest Capacity.
        Arrays.sort(colaCapacity);
        BigInteger maxTwoCanCapacity = colaCapacity[canCount-1]+
        colaCapacity[canCount-2];
        //Verdict.
        if(maxTwoCanCapacity>= totalColaVolume){
            System.out.println("YES");
        }
        else System.out.println("NO");
    }
    public static final Scanner Console = new Scanner(System.in);
}


import java.util.Scanner;
import java.math.BigInteger;
import java.util.Arrays;

public class Greed{
    public static void main(String []args){
        //For Storing Problem Data.
        int canCount = Console.nextInt();
        BigInteger [] colaVolume   = new BigInteger [canCount];
        BigInteger [] colaCapacity = new BigInteger [canCount];
        //Getting Cola for each Can.
        BigInteger totalColaVolume = new BigInteger("0");
        for(int x = 0;x<canCount;++x){
            totalColaVolume = totalColaVolume.add(colaVolume[x] = Console.nextBigInteger());
        }
        //Getting Total Capacity for each Can.
        for (int x = 0;x<canCount;++x){
            colaCapacity[x] = Console.nextBigInteger();
        }
        //Sorting to find Cans with Highest Capacity.
        Arrays.sort(colaCapacity);
        BigInteger maxTwoCanCapacity = colaCapacity[canCount-1].add(colaCapacity[canCount-2]);
        System.out.println(maxTwoCanCapacity+" "+totalColaVolume);
        //Verdict.
        if(maxTwoCanCapacity.compareTo(totalColaVolume)>=0){
            System.out.println("YES");
        }
        else System.out.println("NO");
    }
    public static final Scanner Console = new Scanner(System.in);
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int tc;
            int[] maxTwo = new int[2];
            long vSum = 0;
            for (int i = 0; i < n; ++i) {
                vSum += in.nextInt();
            }
            maxTwo[0] = in.nextInt();
            maxTwo[1] = in.nextInt();
            int min = maxTwo[0] > maxTwo[1] ? 1 : 0;
            int max = 1 - min;
            for (int i = 2; i < n; ++i) {
                tc = in.nextInt();
                maxTwo[min] = tc;
                min = tc > maxTwo[max] ? max : min;
                max = 1 - min;
            }
            System.out.println(maxTwo[0] + maxTwo[1] >= vSum ? "YES" : "NO");
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int tc;
            int[] maxTwo = new int[2];
            int vSum = 0;
            for (int i = 0; i < n; ++i) {
                vSum += in.nextInt();
            }
            maxTwo[0] = in.nextInt();
            maxTwo[1] = in.nextInt();
            int min = maxTwo[0] > maxTwo[1] ? 1 : 0;
            int max = 1 - min;
            for (int i = 2; i < n; ++i) {
                tc = in.nextInt();
                maxTwo[min] = tc;
                min = tc > maxTwo[max] ? max : min;
                max = 1 - min;
            }
            System.out.println(maxTwo[0] + maxTwo[1] >= vSum ? "YES" : "NO");
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int tc;
            int[] maxTwo = new int[2];
            long vSum = 0;
            for (int i = 0; i < n; ++i) {
                vSum += in.nextInt();
            }
            maxTwo[0] = in.nextInt();
            maxTwo[1] = in.nextInt();
            int min = maxTwo[0] > maxTwo[1] ? 1 : 0;
            int max = 1 - min;
            for (int i = 2; i < n; ++i) {
                tc = in.nextInt();
                if (tc > maxTwo[min]) {
                    maxTwo[min] = tc;
                    min = maxTwo[min] > maxTwo[max] ? max : min;
                    max = 1 - min;
                }
            }
            System.out.println(maxTwo[0] + maxTwo[1] >= vSum ? "YES" : "NO");
        }
    }
}


// N cola (a,b) (in,cap)
// put cola into max of 2 cans;
// 5:06 start
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
public class A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		StringTokenizer st = new StringTokenizer(sc.nextLine());
		long rem = 0;
		for (int i = 0;i < n;i++){
			rem += Integer.parseInt(st.nextToken());

		}
		int[] u = new int[n];
		st = new StringTokenizer(sc.nextLine());
	//	int rem = 0;

		for (int i = 0;i < n;i++){
			int k = Integer.parseInt(st.nextToken());
			u[i] = k;
		}
		Arrays.sort(u);
		int w1 = u[u.length-1];
		int w2 = u[u.length-2];

		if (w2 + w1 >= rem){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
		//System.out.println(w1 + w2 +" and "+ rem);
	}

}


// N cola (a,b) (in,cap)
// put cola into max of 2 cans;
// 5:06 start
import java.util.Scanner;
import java.util.StringTokenizer;
public class A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		StringTokenizer st = new StringTokenizer(sc.nextLine());
		int rem = 0;
		for (int i = 0;i < n;i++){
			rem += Integer.parseInt(st.nextToken());

		}
		int w1 = -1;
		int w2 = -1;
		st = new StringTokenizer(sc.nextLine());
	//	int rem = 0;
		for (int i = 0;i < n;i++){
			int k = Integer.parseInt(st.nextToken());
			if(k > w2){
				w2 = k;
				if(w2 > w1){
					int tmp = w1;
					w1 = w2;
					w2 = tmp;
				}
			}
		}

		if (w2 + w1 >= rem){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
		System.out.println(w1 + w2 +" and "+ rem);
	}

}


// N cola (a,b) (in,cap)
// put cola into max of 2 cans;
// 5:06 start
import java.util.Scanner;
import java.util.StringTokenizer;
public class A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		StringTokenizer st = new StringTokenizer(sc.nextLine());
		int rem = 0;
		for (int i = 0;i < n;i++){
			rem += Integer.parseInt(st.nextToken());

		}
		int w1 = -1;
		int w2 = -1;
		st = new StringTokenizer(sc.nextLine());
	//	int rem = 0;
		for (int i = 0;i < n;i++){
			int k = Integer.parseInt(st.nextToken());
			if(k > w2){
				w2 = k;
				if(w2 > w1){
					int tmp = w1;
					w1 = w2;
					w2 = tmp;
				}
			}
		}

		if (w2 + w1 >= rem){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}

}


// N cola (a,b) (in,cap)
// put cola into max of 2 cans;
// 5:06 start
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
public class A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		StringTokenizer st = new StringTokenizer(sc.nextLine());
		int rem = 0;
		for (int i = 0;i < n;i++){
			rem += Integer.parseInt(st.nextToken());

		}
		int[] u = new int[n];
		st = new StringTokenizer(sc.nextLine());
	//	int rem = 0;

		for (int i = 0;i < n;i++){
			int k = Integer.parseInt(st.nextToken());
			u[i] = k;
		}
		Arrays.sort(u);
		int w1 = u[u.length-1];
		int w2 = u[u.length-2];

		if (w2 + w1 >= rem){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
		//System.out.println(w1 + w2 +" and "+ rem);
	}

}


// N cola (a,b) (in,cap)
// put cola into max of 2 cans;
// 5:06 start
import java.util.Scanner;
import java.util.StringTokenizer;
public class A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		StringTokenizer st = new StringTokenizer(sc.nextLine());
		int rem = 0;
		for (int i = 0;i < n;i++){
			rem += Integer.parseInt(st.nextToken());

		}
		int w1 = -1;
		int w2 = -1;
		st = new StringTokenizer(sc.nextLine());
	//	int rem = 0;
		for (int i = 0;i < n;i++){
			int k = Integer.parseInt(st.nextToken());
			if(k > w2){
				w2 = k;
				if(w2 > w1){
					int tmp = w1;
					w1 = w2;
					w2 = tmp;
				}
			}
		}

		// hi

		if (w2 + w1 >= rem){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}

}


// N cola (a,b) (in,cap)
// put cola into max of 2 cans;
// 5:01 start
import java.util.Scanner;
import java.util.StringTokenizer;
public class A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		int rem = 0;
		int w1 = -1;
		int w2 = -1;
		for (int i = 0;i < n;i++){
			StringTokenizer st = new StringTokenizer(sc.nextLine());
			int ku = Integer.parseInt(st.nextToken());
			rem += ku;
			int cap = Integer.parseInt(st.nextToken());
			if (cap > w2){
				if(cap > w1){
					w2 = w1;
					w1 = cap;
				}
				else{
					w2 = cap;
				}
			}
		}
		if (w2 + w1 >= rem){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Greed892A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int cola = 0;
		int[] volumes = new int[n];
		for (int i = 0; i < n; i++) {
			cola += sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			volumes[i] = sc.nextInt();
		}
		Arrays.sort(volumes);
		if (cola > (volumes[n-1]+volumes[n-2])) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class ProblemA {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		if(n == 2) {
			System.out.println("YES");
			return;
		}
		long volume = 0;
		long[] cans = new long[(int) n];
		for(long i = 0; i < n; i++) {
			volume += scan.nextLong();
		}
		for(long i = 0; i < n; i++) {
			cans[(int) i] = scan.nextLong();
		}
		Arrays.sort(cans);

		if(volume <= cans[(int) (n-1)] + cans[(int) (n-2)]) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class ProblemA {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int capacity = 0;
		int[] cans = new int[n];
		for(int i = 0; i < n; i++) {
			capacity += scan.nextInt();
		}
		for(int i = 0; i < n; i++) {
			cans[i] = scan.nextInt();
		}
		Arrays.sort(cans);
		if(capacity <= cans[n-1] + cans[n-2]) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Greed892A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long cola = 0;
		long[] volumes = new long[n];
		for (int i = 0; i < n; i++) {
			cola += sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			volumes[i] = sc.nextInt();
		}
		Arrays.sort(volumes);
		if (cola > (volumes[n-1]+volumes[n-2])) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     int[] a= new int[n];

	     int[] b= new int[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();
	     }

	     int sum_a = IntStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<(b[b.length-1])+(b[b.length-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     int[] a= new int[n];

	     int[] b= new int[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();
	     }

	     int sum_a = IntStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<=(b[b.length-1])+(b[b.length-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
	     int n = sc.nextInt();

	     int[] a= new int[n];

	     int[] b= new int[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();

	     }

	     int sum_a = IntStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<=(b[n-1]+b[n-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();

	     int[] a= new int[n];

	     int[] b= new int[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();
	    	 if(b[i]>=a[i]) {
	    		 return;
	    	 }

	    	 else {
	    		 continue;
	    	 }
	     }

	     int sum_a = IntStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<=(b[b.length-1])+(b[b.length-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	     System.out.println(b[b.length-1]);
	     System.out.println(b[b.length-2]);

	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     if(n<2) {
	    	 return;
	     }
	     int[] a= new int[n];

	     int[] b= new int[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();
	    	 if(b[i]>=a[i]) {
	    		 return;
	    	 }

	    	 else {
	    		 continue;
	    	 }
	     }

	     int sum_a = IntStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<=(b[b.length-1])+(b[b.length-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();

	     int[] a= new int[n];

	     int[] b= new int[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();

	     }

	     int sum_a = IntStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<=(b[b.length-1])+(b[b.length-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();
	     if(n<2) {
	    	 return;
	     }
	     int[] a= new int[n];

	     int[] b= new int[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();
	    	 if(b[i]>=a[i]) {
	    		 return;
	    	 }

	    	 else {
	    		 continue;
	    	 }
	     }

	     int sum_a = IntStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<=(b[b.length-1])+(b[b.length-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	     System.out.println(b[b.length-1]);
	     System.out.println(b[b.length-2]);

	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	     int n = sc.nextInt();

	     int[] a= new int[n];

	     int[] b= new int[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();
	    	 if(b[i]>=a[i]) {
	    		 return;
	    	 }

	    	 else {
	    		 continue;
	    	 }
	     }

	     int sum_a = IntStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<=(b[b.length-1])+(b[b.length-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;
import java.util.stream.LongStream;

public class Main {

	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
	     int n = sc.nextInt();

	     long[] a= new long[n];

	     long[] b= new long[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();

	     }

	     long sum_a = LongStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<=(b[n-1]+b[n-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	}

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
	     int n = sc.nextInt();

	     int[] a= new int[n];

	     int[] b= new int[n];

	     for(int i=0;i<n;i++) {
	    	 a[i]=sc.nextInt();
	     }

	     for(int i=0;i<n;i++) {
	    	 b[i]=sc.nextInt();

	     }

	     int sum_a = IntStream.of(a).sum();
	     Arrays.sort(b);
	     if(sum_a<=(b[n-1])+(b[n-2])) {
	    	 System.out.println("YES");
	     }else {
	    	 System.out.println("NO");
	     }

	}

}


#include <bits/stdc++.h>
using namespace std;
#define N 1000010
int n,m,l,r,Sz,x;
vector<int> Ends[N];
vector<int> now;

vector<int> Seg[N*5];
vector<int> Lazy[N*5];

void Merge(vector<int> &ret,vector<int> node1,vector<int> node2)
{
    int i1=0,    i2=0;
    while(i1<node1.size() && i2<node2.size())
    {
        if(node1[i1] < node2[i2])
            ret.push_back(node1[i1++]);
        else
            ret.push_back(node2[i2++]);
    }
    while(i1<node1.size()) ret.push_back(node1[i1++]);
    while(i2<node2.size()) ret.push_back(node2[i2++]);
}

void Build(int node=1 , int Start=1 , int End=N)
{
    if(Start==End)
    {
        sort(Ends[Start].begin(),Ends[Start].end());
        Seg[node]=Ends[Start];
        return ;
    }
    int Mid=(Start+End)/2;
    Build(2*node,Start,Mid);
    Build(2*node+1,Mid+1,End);

    Merge(Seg[node],Seg[2*node] , Seg[2*node+1]);
}

int Query(int left , int right , int node=1 , int Start=1 , int End=N)
{
    if(left > End  || right < Start)    return 0;
    if(Start >= left && End <= right)
        return lower_bound(Seg[node].begin(),Seg[node].end(),right)-Seg[node].begin();
    int Mid=(Start+End)/2;
    int p1=Query(left,right,2*node,Start,Mid);
    int p2=Query(left,right,2*node+1,Mid+1,End);
    return p1+p2;
}

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1 ; i<=n ; i++)
    {
        scanf("%d%d",&l,&r);
        Ends[l].push_back(r);
    }
    Build();

    for(int i=1;  i<=m ; i++)
    {
        now.clear();
        now.push_back(0);
        scanf("%d",&Sz);
        while(Sz--)
        {
            scanf("%d",&x);
            now.push_back(x);
        }
        now.push_back(N);
        int Res=n;
        for(int i=1 ; i<now.size() ; i++)
            Res-=Query(now[i-1]+1,now[i]);
        cout<<Res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N 1000010
ll n,m,l,r,Sz,x;
vector<ll> Ends[N];
vector<ll> now;

vector<ll> Seg[N*5];
vector<ll> Lazy[N*5];

void Merge(vector<ll> &ret,vector<ll> node1,vector<ll> node2)
{
    ll i1=0,    i2=0;
    while(i1<node1.size() && i2<node2.size())
    {
        if(node1[i1] < node2[i2])
            ret.push_back(node1[i1++]);
        else
            ret.push_back(node2[i2++]);
    }
    while(i1<node1.size()) ret.push_back(node1[i1++]);
    while(i2<node2.size()) ret.push_back(node2[i2++]);
}

void Build(ll node=1 , ll Start=1 , ll End=N)
{
    if(Start==End)
    {
        sort(Ends[Start].begin(),Ends[Start].end());
        Seg[node]=Ends[Start];
        return ;
    }
    ll Mid=(Start+End)/2;
    Build(2*node,Start,Mid);
    Build(2*node+1,Mid+1,End);

    Merge(Seg[node],Seg[2*node] , Seg[2*node+1]);
}

ll Query(ll left , ll right , ll node=1 , ll Start=1 , ll End=N)
{
    if(left > End  || right < Start)    return 0;
    if(Start >= left && End <= right)
        return lower_bound(Seg[node].begin(),Seg[node].end(),right)-Seg[node].begin();
    ll Mid=(Start+End)/2;
    ll p1=Query(left,right,2*node,Start,Mid);
    ll p2=Query(left,right,2*node+1,Mid+1,End);
    return p1+p2;
}

int main()
{
    scanf("%d%d",&n,&m);
    for(ll i=1 ; i<=n ; i++)
    {
        scanf("%d%d",&l,&r);
        Ends[l].push_back(r);
    }
    Build();

    for(ll i=1;  i<=m ; i++)
    {
        now.clear();
        now.push_back(0);
        scanf("%d",&Sz);
        while(Sz--)
        {
            scanf("%d",&x);
            now.push_back(x);
        }
        now.push_back(N);
        ll Res=n;
        for(ll i=1 ; i<now.size() ; i++)
            Res-=Query(now[i-1]+1,now[i]);
        cout<<Res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 1000010
int n,m,l,r,Sz,x;
vector<int> Ends[N];
vector<int> now;

vector<int> Seg[N*5];

void Merge(vector<int> &ret,vector<int> &node1,vector<int> &node2)
{
    int i1=0,    i2=0;
    int n1=node1.size(),n2=node2.size();
    while(i1<n1 && i2<n2)
    {
        if(node1[i1] < node2[i2])
            ret.push_back(node1[i1++]);
        else
            ret.push_back(node2[i2++]);
    }
    while(i1<n1) ret.push_back(node1[i1++]);
    while(i2<n2) ret.push_back(node2[i2++]);
}

void Build(int node=1 , int Start=1 , int End=N)
{
    if(Start==End)
    {
        sort(Ends[Start].begin(),Ends[Start].end());
        Seg[node]=Ends[Start];
        return ;
    }
    int Mid=(Start+End)/2;
    Build(2*node,Start,Mid);
    Build(2*node+1,Mid+1,End);

    Merge(Seg[node],Seg[2*node] , Seg[2*node+1]);
}

int Query(int left , int right , int node=1 , int Start=1 , int End=N)
{
    if(left > End  || right < Start)    return 0;
    if(Start >= left && End <= right)
        return lower_bound(Seg[node].begin(),Seg[node].end(),right)-Seg[node].begin();
    int Mid=(Start+End)/2;
    int p1=Query(left,right,2*node,Start,Mid);
    int p2=Query(left,right,2*node+1,Mid+1,End);
    return p1+p2;
}

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1 ; i<=n ; i++)
    {
        scanf("%d%d",&l,&r);
        Ends[l].push_back(r);
    }
    Build();

    for(int i=1;  i<=m ; i++)
    {
        now.clear();
        now.push_back(0);
        scanf("%d",&Sz);
        while(Sz--)
        {
            scanf("%d",&x);
            now.push_back(x);
        }
        now.push_back(N);
        int Res=n;
        for(int i=1 ; i<now.size() ; i++)
            Res-=Query(now[i-1]+1,now[i]);
        cout<<Res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N 1000001
ll n,m,l,r,Sz,x;
vector<ll> Ends[N];#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N 1000010
ll n,m,l,r,Sz,x;
vector<ll> Ends[N];
vector<ll> now;

vector<ll> Seg[N*5];
vector<ll> Lazy[N*5];

void Merge(vector<ll> &ret,vector<ll> node1,vector<ll> node2)
{
    ll i1=0,    i2=0;
    while(i1<node1.size() && i2<node2.size())
    {
        if(node1[i1] < node2[i2])
            ret.push_back(node1[i1++]);
        else
            ret.push_back(node2[i2++]);
    }
    while(i1<node1.size()) ret.push_back(node1[i1++]);
    while(i2<node2.size()) ret.push_back(node2[i2++]);
}

void Build(ll node=1 , ll Start=1 , ll End=N)
{
    if(Start==End)
    {
        sort(Ends[Start].begin(),Ends[Start].end());
        Seg[node]=Ends[Start];
        return ;
    }
    ll Mid=(Start+End)/2;
    Build(2*node,Start,Mid);
    Build(2*node+1,Mid+1,End);

    Merge(Seg[node],Seg[2*node] , Seg[2*node+1]);
}

ll Query(ll left , ll right , ll node=1 , ll Start=1 , ll End=N)
{
    if(left > End  || right < Start)    return 0;
    if(Start >= left && End <= right)
        return lower_bound(Seg[node].begin(),Seg[node].end(),right)-Seg[node].begin();
    ll Mid=(Start+End)/2;
    ll p1=Query(left,right,2*node,Start,Mid);
    ll p2=Query(left,right,2*node+1,Mid+1,End);
    return p1+p2;
}

int main()
{
    scanf("%d%d",&n,&m);
    for(ll i=1 ; i<=n ; i++)
    {
        scanf("%d%d",&l,&r);
        Ends[l].push_back(r);
    }
    Build();

    for(ll i=1;  i<=m ; i++)
    {
        now.clear();
        now.push_back(0);
        scanf("%d",&Sz);
        while(Sz--)
        {
            scanf("%d",&x);
            now.push_back(x);
        }
        now.push_back(N);
        ll Res=n;
        for(ll i=1 ; i<now.size() ; i++)
            Res-=Query(now[i-1]+1,now[i]);
        cout<<Res<<endl;
    }
    return 0;
}

vector<ll> now;

vector<ll> Seg[N*5];
vector<ll> Lazy[N*5];

void Merge(vector<ll> &ret,vector<ll> node1,vector<ll> node2)
{
    ll i1=0,    i2=0;
    while(i1<node1.size() && i2<node2.size())
    {
        if(node1[i1] < node2[i2])
            ret.push_back(node1[i1++]);
        else
            ret.push_back(node2[i2++]);
    }
    while(i1<node1.size()) ret.push_back(node1[i1++]);
    while(i2<node2.size()) ret.push_back(node2[i2++]);
}

void Build(ll node=1 , ll Start=1 , ll End=N)
{
    if(Start==End)
    {
        sort(Ends[Start].begin(),Ends[Start].end());
        Seg[node]=Ends[Start];
        return ;
    }
    ll Mid=(Start+End)/2;
    Build(2*node,Start,Mid);
    Build(2*node+1,Mid+1,End);

    Merge(Seg[node],Seg[2*node] , Seg[2*node+1]);
}

ll Query(ll left , ll right , ll node=1 , ll Start=1 , ll End=N)
{
    if(left > End  || right < Start)    return 0;
    if(Start >= left && End <= right)
        return lower_bound(Seg[node].begin(),Seg[node].end(),right)-Seg[node].begin();
    ll Mid=(Start+End)/2;
    ll p1=Query(left,right,2*node,Start,Mid);
    ll p2=Query(left,right,2*node+1,Mid+1,End);
    return p1+p2;
}

int main()
{
    scanf("%d%d",&n,&m);
    for(ll i=1 ; i<=n ; i++)
    {
        scanf("%d%d",&l,&r);
        Ends[l].push_back(r);
    }
    Build();

    for(ll i=1;  i<=m ; i++)
    {
        now.clear();
        now.push_back(0);
        scanf("%d",&Sz);
        while(Sz--)
        {
            scanf("%d",&x);
            now.push_back(x);
        }
        now.push_back(N);
        ll Res=n;
        for(ll i=1 ; i<now.size() ; i++)
            Res-=Query(now[i-1]+1,now[i]);
        cout<<Res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N 1000001
ll n,m,l,r,Sz,x;
vector<ll> Ends[N];
vector<ll> now;

vector<ll> Seg[N*5];
vector<ll> Lazy[N*5];

void Merge(vector<ll> &ret,vector<ll> node1,vector<ll> node2)
{
    ll i1=0,    i2=0;
    while(i1<node1.size() && i2<node2.size())
    {
        if(node1[i1] < node2[i2])
            ret.push_back(node1[i1++]);
        else
            ret.push_back(node2[i2++]);
    }
    while(i1<node1.size()) ret.push_back(node1[i1++]);
    while(i2<node2.size()) ret.push_back(node2[i2++]);
}

void Build(ll node=1 , ll Start=1 , ll End=N)
{
    if(Start==End)
    {
        sort(Ends[Start].begin(),Ends[Start].end());
        Seg[node]=Ends[Start];
        return ;
    }
    ll Mid=(Start+End)/2;
    Build(2*node,Start,Mid);
    Build(2*node+1,Mid+1,End);

    Merge(Seg[node],Seg[2*node] , Seg[2*node+1]);
}

ll Query(ll left , ll right , ll node=1 , ll Start=1 , ll End=N)
{
    if(left > End  || right < Start)    return 0;
    if(Start >= left && End <= right)
        return lower_bound(Seg[node].begin(),Seg[node].end(),right)-Seg[node].begin();
    ll Mid=(Start+End)/2;
    ll p1=Query(left,right,2*node,Start,Mid);
    ll p2=Query(left,right,2*node+1,Mid+1,End);
    return p1+p2;
}

int main()
{
    scanf("%d%d",&n,&m);
    for(ll i=1 ; i<=n ; i++)
    {
        scanf("%d%d",&l,&r);
        Ends[l].push_back(r);
    }
    Build();

    for(ll i=1;  i<=m ; i++)
    {
        now.clear();
        now.push_back(0);
        scanf("%d",&Sz);
        while(Sz--)
        {
            scanf("%d",&x);
            now.push_back(x);
        }
        now.push_back(N);
        ll Res=n;
        for(ll i=1 ; i<now.size() ; i++)
            Res-=Query(now[i-1]+1,now[i]);
        cout<<Res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 1000010
int n,m,l,r,Sz,x;
vector<int> Ends[N];
vector<int> now;

vector<int> Seg[N*5];
vector<int> Lazy[N*5];

void Merge(vector<int> &ret,vector<int> node1,vector<int> node2)
{
    int i1=0,    i2=0;
    int n1=node1.size(),n2=node2.size();
    while(i1<n1 && i2<n2)
    {
        if(node1[i1] < node2[i2])
            ret.push_back(node1[i1++]);
        else
            ret.push_back(node2[i2++]);
    }
    while(i1<n1) ret.push_back(node1[i1++]);
    while(i2<n2) ret.push_back(node2[i2++]);
}

void Build(int node=1 , int Start=1 , int End=N)
{
    if(Start==End)
    {
        sort(Ends[Start].begin(),Ends[Start].end());
        Seg[node]=Ends[Start];
        return ;
    }
    int Mid=(Start+End)/2;
    Build(2*node,Start,Mid);
    Build(2*node+1,Mid+1,End);

    Merge(Seg[node],Seg[2*node] , Seg[2*node+1]);
}

int Query(int left , int right , int node=1 , int Start=1 , int End=N)
{
    if(left > End  || right < Start)    return 0;
    if(Start >= left && End <= right)
        return lower_bound(Seg[node].begin(),Seg[node].end(),right)-Seg[node].begin();
    int Mid=(Start+End)/2;
    int p1=Query(left,right,2*node,Start,Mid);
    int p2=Query(left,right,2*node+1,Mid+1,End);
    return p1+p2;
}

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1 ; i<=n ; i++)
    {
        scanf("%d%d",&l,&r);
        Ends[l].push_back(r);
    }
    Build();

    for(int i=1;  i<=m ; i++)
    {
        now.clear();
        now.push_back(0);
        scanf("%d",&Sz);
        while(Sz--)
        {
            scanf("%d",&x);
            now.push_back(x);
        }
        now.push_back(N);
        int Res=n;
        for(int i=1 ; i<now.size() ; i++)
            Res-=Query(now[i-1]+1,now[i]);
        cout<<Res<<endl;
    }
    return 0;
}


//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int,int>;

#define int ll

int const N = 3e5+10, MX = 1e6+10;
int n, m, ans[N], fen[MX];
vector <int> seg[MX];
vector <pii> que[MX];

void add (int p){
	for (p++; p < MX; p += p&-p) fen[p] ++;
}

inline int get (int p){
	int res = 0;
	for (; p; p -= p&-p) res += fen[p];
	return res;
}

int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	for (int i = 0, l, r; i < n; i ++) cin >> l >> r, seg[r].push_back(l);
	for (int i = 0; i < m; i ++){
		int cnt, p = 0; cin >> cnt;
		for (int j = 0, x; j < cnt; j ++){
			cin >> x;
			que[x].push_back({p, i});
			p = x;
		}
		que[MX-3].push_back({p, i});
	}

	for (int i = 0; i < MX; i ++){
	 	for (pii p: que[i]) ans[p.second] += get(i) - get(p.first+1);
		for (int x: seg[i]) add(x);
	}

	for (int i = 0; i < m; i ++) cout << (ans[i] = n - ans[i]) << '\n';
}


//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int,int>;

#define int ll

int const N = 3e5+10, MX = 1e6+10;
int n, m, ans[N], fen[MX];
vector <int> seg[MX];
vector <pii> que[MX];

void add (int p){
	for (p++; p < MX; p += p&-p) fen[p] ++;
}

inline int get (int p){
	int res = 0;
	for (; p; p -= p&-p) res += fen[p];
	return res;
}

int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	for (int i = 0, l, r; i < n; i ++) cin >> l >> r, seg[r].push_back(l);
	for (int i = 0; i < m; i ++){
		int cnt, p = 0; cin >> cnt;
		for (int j = 0, x; j < cnt; j ++){
			cin >> x;
			que[x].push_back({p, i});
			p = x;
		}
		que[MX-3].push_back({p, i});
	}

	for (int i = 0; i < MX; i ++){
	 	for (pii p: que[i]) ans[p.second] += get(i) - get(p.first+1);
		for (int x: seg[i]) add(x);
	}

	for (int i = 0; i < n; i ++) cout << (ans[i] = n - ans[i]) << '\n';
}


//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

using namespace std;

#define _sz(x) (int)x.size()

int const MX = 1e6+20;
int n, m, p[MX];
vector <int> seg[MX<<2], vec[MX];

void build (int v = 1, int s = 0, int e = MX){
	if (s+1 == e){
	  	sort(vec[s].begin(), vec[s].end());
		for (int x: vec[s]) seg[v].push_back(x);
		return ;
	}
	int mid = (s+e)>>1, lc = v<<1, rc = lc|1;
	build(lc, s, mid), build(rc, mid, e);

	int p1 = 0, p2 = 0;
	while (p1 < _sz(seg[lc]) || p2 < _sz(seg[rc])){
		if (p1 == _sz(seg[lc])) seg[v].push_back(seg[rc][p2++]);
		else if (p2 == _sz(seg[rc])) seg[v].push_back(seg[lc][p1++]);
		else if (seg[lc][p1] < seg[rc][p2]) seg[v].push_back(seg[lc][p1++]);
		else seg[v].push_back(seg[rc][p2++]);
	}
}

int get (int l, int r, int xl, int xr, int v = 1, int s = 0, int e = MX){
	if (s >= r || e <= l) return 0;
	if (s >= l && e <= r){
	  	int id1 = lower_bound(seg[v].begin(), seg[v].end(), xl) - seg[v].begin();
		int id2 = upper_bound(seg[v].begin(), seg[v].end(), xr) - seg[v].begin();
		return id2 - id1;
	}
	int mid = (s+e)>>1, lc = v<<1, rc = lc|1;
	return get(l,r,xl,xr,lc,s,mid) + get(l,r,xl,xr,rc,mid,e);
}

int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	for (int i = 0, l, r; i < n; i ++){
		cin >> l >> r;
		vec[r].push_back(l);
	}
	build();
	for (int i = 0; i < m; i ++){
		int cnt, ans = 0; cin >> cnt;
		p[0] = -1;
		for (int i = 1; i <= cnt; i ++){
			cin >> p[i];
			ans += get(p[i], MX, p[i-1]+1, p[i]);
		}
		cout << ans << '\n';
	}
}


#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

struct Counter
{
	static int k;
	Counter() {k++;}
	~Counter() {k--;}
};

int Counter::k = 0;

template<typename T>
void pr(const string& name, T t)
{
    cout << name << " = " << t << endl;
}

template<typename T, typename ... Types>
void pr(const string& names, T t, Types ... rest)
{
    auto comma_pos = names.find(',');
    cout << names.substr(0, comma_pos) << " = " << t << ", ";

    auto next_name_pos = names.find_first_not_of(" \t\n", comma_pos + 1);
    pr(string(names, next_name_pos), rest ...);
}

void mod(ll &a, ll b)
{
    a %= b;
    if(a < 0) a += b;
}

#define all(x) x.begin(), x.end()
#define f(i,a,b) for(int i = (a); i <= (b); i++)
#define fd(i,a,b) for(int i = (a); i >= (b); i--)
#define mp make_pair
#define faster_io() ios_base::sync_with_stdio(false)
#define pb push_back
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define trace(...) pr(#__VA_ARGS__, __VA_ARGS__);
#define tracea(x) {string s = #x; Counter c##x; cout<<s.substr(0,1+s.find('['))<<Counter::k<<"]="<<x<<'\n';}
#define vii vector<pair<int,int>>

const ll MOD = 1000000007;

// ----------------------------------------------------------------------------------------------------------

struct Event
{
    int type, x, v, id;
    Event(int p1, int p2, int p3, int p4) : type(p1), x(p2), v(p3), id(p4) {};
    friend bool operator < (Event e1, Event e2)
    {
        if(e1.x != e2.x) return e1.x < e2.x;
        return e1.type < e2.type;
    }
};

enum {SEG,QUERY};
int Ans[300005], N, Q, T[1000005];
multiset<Event> Events;

void update(int x)
{
    while(x > 0)
    {
        T[x]++;
        x -= x&-x;
    }
}

int query(int x)
{
    int ret = 0;
    while(x <= 1000000)
    {
        ret += T[x];
        x += x&-x;
    }
    return ret;
}

int main()
{
    scanf("%d%d",&N,&Q);
    f(i,1,N)
    {
        int l,r;
        scanf("%d%d",&l,&r);
        Events.insert(Event(SEG,r,l,0));
    }
    f(q,1,Q)
    {
        int cnt;
        scanf("%d",&cnt);
        int l = 0;
        f(i,1,cnt)
        {
            int x;
            scanf("%d",&x);
            Events.insert(Event(QUERY,x-1,l+1,q));
            l = x;
        }
        Events.insert(Event(QUERY,1000000,l+1,q));
    }

    for(Event e : Events)
    {
        if(e.type == SEG) update(e.v);
        else Ans[e.id] += query(e.v);
    }

    f(i,1,Q) cout << N - Ans[i] << "\n";
}


#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

struct Counter
{
	static int k;
	Counter() {k++;}
	~Counter() {k--;}
};

int Counter::k = 0;

template<typename T>
void pr(const string& name, T t)
{
    cout << name << " = " << t << endl;
}

template<typename T, typename ... Types>
void pr(const string& names, T t, Types ... rest)
{
    auto comma_pos = names.find(',');
    cout << names.substr(0, comma_pos) << " = " << t << ", ";

    auto next_name_pos = names.find_first_not_of(" \t\n", comma_pos + 1);
    pr(string(names, next_name_pos), rest ...);
}

void mod(ll &a, ll b)
{
    a %= b;
    if(a < 0) a += b;
}

#define all(x) x.begin(), x.end()
#define f(i,a,b) for(int i = (a); i <= (b); i++)
#define fd(i,a,b) for(int i = (a); i >= (b); i--)
#define mp make_pair
#define faster_io() ios_base::sync_with_stdio(false)
#define pb push_back
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define trace(...) pr(#__VA_ARGS__, __VA_ARGS__);
#define tracea(x) {string s = #x; Counter c##x; cout<<s.substr(0,1+s.find('['))<<Counter::k<<"]="<<x<<'\n';}
#define vii vector<pair<int,int>>

const ll MOD = 1000000007;

// ----------------------------------------------------------------------------------------------------------

int Ans[300005], N, Q, T[1000005];
vector<int> Segs[1000005];
vii Queries[1000005];

void update(int x)
{
    while(x > 0)
    {
        T[x]++;
        x -= x&-x;
    }
}

int query(int x)
{
    int ret = 0;
    while(x <= 1000000)
    {
        ret += T[x];
        x += x&-x;
    }
    return ret;
}

int main()
{
    scanf("%d%d",&N,&Q);
    f(i,1,N)
    {
        int l,r;
        scanf("%d%d",&l,&r);
        Segs[r].pb(l);
    }
    f(q,1,Q)
    {
        int cnt;
        scanf("%d",&cnt);
        int l = 0;
        f(i,1,cnt)
        {
            int x;
            scanf("%d",&x);
            Queries[x-1].pb({l+1,q});
            l = x;
        }
        Queries[1000000].pb({l+1,q});
    }

    f(x,1,1000000)
    {
        for(int v : Segs[x]) update(v);
        for(pii p : Queries[x]) Ans[p.second] += query(p.first);
    }

    f(i,1,Q) cout << N - Ans[i] << "\n";
}