#include<iostream>
using namespace std;

int main(){
    int n;cin>>n;
    int xy[110][2]={0};
    bool f=false;
    for(int i=0;i<n;++i)cin>>xy[i][0]>>xy[i][1];
    for(int i=0;i<n-1;++i){
        for(int j=i+1;j<n-1;++j){
            for(int k=j+1;k<n;++k){
                int x1=xy[i][0]-xy[k][0];
                int y1=xy[i][1]-xy[k][1];
                int x2=xy[j][0]-xy[k][0];
                int y2=xy[j][1]-xy[k][1];
                if(x1*y2==x2*y1)f=true;
            }
        }
    }
    if(f)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}
#include<bits/stdc++.h>
#define pb           push_back
#define mp           make_pair
#define pf printf
#define ff first
#define ss second
#define sef second.first
#define ses second.second
#define PI 3.14159265 /// tan inverse = atan(value)*(180/PI)

#define ms(a,b)            memset(a, b, sizeof(a))
#define lp(i,a,b) for (int i = a; i <= b; i++)
#define pii                pair <int,int>

#define SL(a)              scanf("%I64d",&a)
#define SLL(a,b)           scanf("%I64d %I64d",&a,&b)
#define PL(x) printf("%I64d\n",(x))
#define PLL(x,y) printf("%I64d %I64d\n",x,y)

#define S(a)              scanf("%d",&a)
#define SS(a,b)           scanf("%d %d",&a,&b)
#define P(x) printf("%d\n",(x))
#define PP(x,y) printf("%d %d\n",x,y)
using namespace std ;
typedef long long ll ;
const int imin = 1e9+100;
const ll maxx = 1e5+10,mod=1e9+7,imax=1e18+10;
int main()
{
   ll n,a=0,b=mod ;
   cin >> n ;
   for(int i=1;i<=n;i++)
   {
       ll x ;
       cin >> x ;
       a = max(x,a);
   }
    for(int i=1;i<=n;i++)
   {
       ll x ;
       cin >> x ;
       b = min(x,b);
   }
   ll ans = max(0LL,b-a+1);
   cout << ans << endl;
   return 0 ;
}
