#include <bits/stdc++.h>
using namespace std;
int tu(int val) { return (1 << val); }
bool iset(int mask, int id) {
  if ((mask & tu(id)) != 0) return true;
  return false;
}
void doset(int &mask, int id) { mask |= tu(id); }
void dounset(int &mask, int id) { mask = mask & (~tu(id)); }
template <typename T>
string tos(T a) {
  stringstream ss;
  string ret;
  ss << a;
  ss >> ret;
  return ret;
}
vector<int> arr;
int main() {
  int n, va;
  while (cin >> n) {
    long long sum = 0;
    for (int(x) = (0); (x) < (n); (x)++) {
      scanf("%d", &va);
      sum += va;
    }
    arr.clear();
    for (int(x) = (0); (x) < (n); (x)++) {
      scanf("%d", &va);
      arr.push_back(va);
    }
    sort(arr.begin(), arr.end());
    long long can = 0;
    can += arr[n - 1];
    can += arr[n - 2];
    if (sum <= can)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}

### Prompt

Develop a solution in CPP to the problem described below:

Jafar has n cans of cola. Each can is described by two integers: remaining volume of cola ai and can's capacity bi (ai ≤  bi).

Jafar has decided to pour all remaining cola into just 2 cans, determine if he can do this or not!

Input

The first line of the input contains one integer n (2 ≤ n ≤ 100 000) — number of cola cans.

The second line contains n space-separated integers a1, a2, ..., an (0 ≤ ai ≤ 109) — volume of remaining cola in cans.

The third line contains n space-separated integers that b1, b2, ..., bn (ai ≤ bi ≤ 109) — capacities of the cans.

Output

Print "YES" (without quotes) if it is possible to pour all remaining cola in 2 cans. Otherwise print "NO" (without quotes).

You can print each letter in any case (upper or lower).

Examples

Input

2
3 5
3 6


Output

YES


Input

3
6 8 9
6 10 12


Output

NO


Input

5
0 0 5 0 0
1 1 8 10 5


Output

YES


Input

4
4 1 0 3
5 2 2 3


Output

YES

Note

In the first sample, there are already 2 cans, so the answer is "YES".

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int tu(int val) { return (1 << val); }
bool iset(int mask, int id) {
  if ((mask & tu(id)) != 0) return true;
  return false;
}
void doset(int &mask, int id) { mask |= tu(id); }
void dounset(int &mask, int id) { mask = mask & (~tu(id)); }
template <typename T>
string tos(T a) {
  stringstream ss;
  string ret;
  ss << a;
  ss >> ret;
  return ret;
}
vector<int> arr;
int main() {
  int n, va;
  while (cin >> n) {
    long long sum = 0;
    for (int(x) = (0); (x) < (n); (x)++) {
      scanf("%d", &va);
      sum += va;
    }
    arr.clear();
    for (int(x) = (0); (x) < (n); (x)++) {
      scanf("%d", &va);
      arr.push_back(va);
    }
    sort(arr.begin(), arr.end());
    long long can = 0;
    can += arr[n - 1];
    can += arr[n - 2];
    if (sum <= can)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}

```