#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<set>
#include<iterator>
#include <map>
#include<cmath>
#include <list>
#include<string>
#include <stdlib.h>
#include<ctime>
#include<cstring>
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define PI 2*acos(0.0)
#define mod 1e09+7
#define inf 2e18
typedef long long ll;
typedef unsigned long long ull;
#define line cout<<endl
using namespace std;
int fy[] = {0, 0, 1, -1};
int fx[] = { -1, 1, 0, 0};
int ara[1001];
int graph[1001][1001];
int main()
{
    fastIO
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    clock_t start, end;
    start = clock();
#endif

    int n;
    cin >> n;
    ull sum = 0;
    ull a[n], b[n];
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++)
    {
        cin >> b[i];
    }
    for (int i = 0; i < n; i++)
    {
        sum += (a[i] * b[i]);
    }
    if (sum == 0)
    {
        cout << "Yes\n";
    }
    else
    {
        cout << "No\n";
    }
#ifndef ONLINE_JUDGE
    end = clock();
    printf("\nTime taken: %.5f\n", ((double) (end - start)) / CLOCKS_PER_SEC);
#endif
    return 0;
}
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=100005;
int n,a[N],b[N],ans;
priority_queue<int>x,y;
signed main()
{
	ios::sync_with_stdio(0);
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		ans+=a[i];
	}
	for(int i=1;i<=n;i++)
	{
		cin>>b[i];
		b[i]-=a[i];
		if(i&1)
			x.push(b[i]);
		else
			y.push(b[i]);
	}
	while(x.size())
	{
		int u=x.top(),v=y.top();
		x.pop(),y.pop();
		if(u+v<0)
			break;
		ans+=u+v;
	}
	cout<<ans<<endl;
	return 0;
}