#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAXN ((ll)(1e5 + 5))
#define pb push_back
#define sz size
#define all(x) x.begin(), x.end()
#define vi vector<int>
int n;
vi a,b;
#define ii pair<int,int>
#define fs first
#define sc second
int cross(ii a,ii b){
return a.fs*b.sc-a.sc*b.fs;
}
int tc(int i,int j,int k){
ii p1={j,b[j]};
ii p2={k,b[k]};
p1.fs-=i;
p2.fs-=i;
p1.sc-=b[i];
p2.sc-=b[i];
return cross(p1,p2);
}
void solve(){
cin>>n;
for(int i=0;i<n;i++){
int x;cin>>x;
a.pb(x);
}
for(int i=0;i<n;i++){
int x;cin>>x;
b.pb(x);
}
vi v;
for(int i=0;i<n;i++){
if(!v.sz()){
v.pb(i);
continue;
}
while(v.sz()>=2 && tc(v[v.sz()-2],v[v.sz()-1],i)<0){
v.pop_back();
}
v.pb(i);
}
bool can=true;
for(int i=1;i<v.sz();i++){
for(int j=v[i-1]+1;j<v[i];j++){
if( (a[j]*(v[i]-v[i-1])) > (((v[i]-v[i-1]) * b[v[i-1]] + j * (b[v[i]]-b[v[i-1]])) )){
can=false;
}
}
}
if(can){
cout<<"YES";
}else{
cout<<"NO";
}
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
solve();
return 0;
}
asdasdasd