#include <bits/stdc++.h>
using namespace std;
long long modInverse(long long a, long long m);
long long power(long long x, unsigned long long y, unsigned long long m);
long long logint(long long x, long long y);
long long power(long long x, unsigned long long y, unsigned long long m) {
  if (y == 0) return 1;
  long long p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long modInverse(long long a, long long m) {
  long long m0 = m;
  long long y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    long long q = a / m;
    long long t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
void pairsort(long long a[], long long b[], long long n) {
  pair<long long, long long> pairt[n];
  for (long long i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (long long i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long logint(long long x, long long y) {
  long long ans = 0;
  long long a = 1;
  for (long long i = 0; i < x; i++) {
    if (x <= a) {
      return ans;
    }
    ans++;
    a *= y;
  }
  return -1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long ar[n], arr[n];
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> ar[i];
    sum += ar[i];
  }
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(ar, ar + n);
  sort(arr, arr + n);
  if (sum <= arr[n - 1] + arr[n - 2]) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}

### Prompt

Generate a Cpp solution to the following problem:

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;
long long modInverse(long long a, long long m);
long long power(long long x, unsigned long long y, unsigned long long m);
long long logint(long long x, long long y);
long long power(long long x, unsigned long long y, unsigned long long m) {
  if (y == 0) return 1;
  long long p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long modInverse(long long a, long long m) {
  long long m0 = m;
  long long y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    long long q = a / m;
    long long t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
void pairsort(long long a[], long long b[], long long n) {
  pair<long long, long long> pairt[n];
  for (long long i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (long long i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long logint(long long x, long long y) {
  long long ans = 0;
  long long a = 1;
  for (long long i = 0; i < x; i++) {
    if (x <= a) {
      return ans;
    }
    ans++;
    a *= y;
  }
  return -1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long ar[n], arr[n];
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> ar[i];
    sum += ar[i];
  }
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(ar, ar + n);
  sort(arr, arr + n);
  if (sum <= arr[n - 1] + arr[n - 2]) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}

```