//雪花飄飄北風嘯嘯
//天地一片蒼茫

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl

#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define lb lower_bound
#define up upper_bound

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
//change less to less_equal for non distinct pbds, but erase will bug

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int n;
int arr[2005];

unordered_set<int> uni;
unordered_map<int,int> m;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin.exceptions(ios::badbit | ios::failbit);
	
	cin>>n;
	rep(x,0,n) cin>>arr[x];
	
	int mn=1e9+5;
	rep(x,0,n) mn=min(mn,arr[x]);
	
	rep(x,0,n){
		if (uni.count(arr[x])) continue;
		uni.insert(arr[x]);
		
		int curr=1;
		while (curr*curr<arr[x]){
			if (arr[x]%curr==0){
				m[curr]=__gcd(m[curr],arr[x]);
				m[arr[x]/curr]=__gcd(m[arr[x]/curr],arr[x]);
			}
			curr++;
		}
		if (curr*curr==arr[x]){
			m[curr]=__gcd(m[curr],arr[x]);
		}
	}
	
	int ans=0;
	for (auto &it:m){
		if (it.fi==it.se && it.fi<=mn) ans++;
	}
	cout<<ans<<endl;
}

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>
#define ks std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define fr(i,a,b) for(int i=a;i<b;i++)
#define pb(a) push_back(a)
#define fi first
#define se second

using namespace std;
const int N=2e5+10;
const ll mod=1e9+7;
const int inf=INT_MAX;

inline ll rd()
{
    ll s=0,f=0;
    char ch=getchar();
    while(ch<'0'&&ch>'9') {if(ch=='-') f=1; ch=getchar();}
    while(ch>='0'&&ch<='9') {s=s*10+ch-'0'; ch=getchar();}
    return f?-s:s;
}
inline void out(int x)
{
    if(x>9) out(x/10);
    putchar(x%10+'0');
}

struct ttt
{
    int n,t;
    int x[N],y[N];
    set<pii> st;
    int dj(int i,int j) {return x[i]*x[j]+y[i]*y[j]; }
    int cj(int i,int j) {return x[i]*y[j]-x[j]*y[i]; }
    void init()  //数据初始化
    {

    }
    void input() //数据输入
    {
        cin>>n;
        fr(i,0,n) cin>>x[i]>>y[i];
        fr(i,1,n) x[i]-=x[0],y[i]-=y[0];t=dj(1,1);
        fr(i,1,n) st.insert({dj(1,i),cj(1,i)});
        fr(i,0,n) cin>>x[i]>>y[i];
    }
    void query() //答案求解
    {
        if(n==1) {cout<<"Yes"<<endl;return ;}
        fr(i,0,n){
            fr(j,0,n){
                if(i==j) continue;
                int nx=x[i]-x[j],ny=y[i]-y[j];
                if(nx*nx+ny*ny!=t) continue;
                int f=1;
                fr(k,0,n) if(k!=i) x[k]-=x[i],y[k]-=y[i];
                x[i]=0,y[i]=0;
                fr(k,0,n) if(k!=i&&k!=j&&!st.count({dj(j,k),cj(j,k)})) {f=0;break; }
                if(f){
                    cout<<"Yes"<<endl;
                    return ;
                }
            }
        }
        cout<<"No"<<endl;
    }
    void debug() //调试
    {

    }
} as;

int main()
{
    ks;
    //int T;cin>>T;while(T--)
    as.input(),as.query();
    return 0;
}
