#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
#define N 110
#define sq(_) ((_) * (_))
#define eps 1e-7
bool equ(double x , double y) {
	return fabs(x - y) < eps; 
}
int n;
double x[2][N] , y[2][N];
double gx , gy;
bool vis[N];
int main() {
	cin >> n;
	for(int t = 0 ; t <= 1 ; t++) {
		gx = gy = 0;
		
		for(int i = 1 ; i <= n ; i++) {
			cin >> x[t][i] >> y[t][i];
			gx += x[t][i] , gy += y[t][i];
//			x[t][i] *= n , y[t][i] *= n;
		} 
		gx /= n * 1.0 , gy /= n * 1.0;
		for(int i = 1 ; i <= n ; i++)
			x[t][i] -= gx , y[t][i] -= gy;
	}
	/*
	for(int t = 0 ; t <= 1 ; t++)
		for(int i = 1 ; i <= n ; i++) {
			cout << x[t][i] << '\t' << y[t][i] << endl;
			
		}*/
	for(int i = 1 ; i <= n ; i++) {
		if(x[0][i] != 0 || y[0][i] != 0) {
			swap(x[0][i] , x[0][1]);
			swap(y[0][i] , y[0][1]);
		}
	}
	for(int i = 1 ; i <= n ; i++) {
//		if(sq(x[1][1]) + sq(y[1][1]) != sq(x[0][i]) + sq(y[0][i]))	continue;
		double angle = atan2(y[1][i] , x[1][i]) - atan2(y[0][1] , x[0][1]);
		memset(vis , 0 , sizeof(vis));
		vis[i] = true;
		for(int j = 1 ; j <= n ; j++) {
			double tx , ty;
			
			tx = x[0][j] * cos(angle) - y[0][j] * sin(angle);
            ty = x[0][j] * sin(angle) + y[0][j] * cos(angle);
			for(int k = 1 ; k <= n ; k++)
				if(equ(tx , x[1][k]) && equ(ty , y[1][k]))
					vis[k] = true;
		}
		bool flag = true;
		for(int j = 1 ; j <= n ; j++)
			if(vis[j] == 0) {
				flag = false;
				break;
			}
		if(flag) {
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}
// ----- In the name of ALLAH, the Most Gracious, the Most Merciful -----

#include<bits/stdc++.h>
using namespace std;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define deb(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define int long long
#define endl "\n"
#define mod 1000000007
#define inf (int)1e18

const int mxn = 65;
int dp[mxn][2];
string a[mxn];
int n;

int solve(int i, bool prev){
    if(i>=n){
        return prev;
    }

    int &ans=dp[i][prev];

    if(ans!=-1) return ans;
    ans = 0;

    if(a[i]=="AND"){
        ans += solve(i+1,prev&true) + solve(i+1,prev&false);
    }else{
        ans += solve(i+1,prev|true) +  solve(i+1,prev|false);
    }
    
    return ans;
}

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    memset(dp,-1,sizeof(dp));

    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i];
    }

    debug() << range(a,a+n);

    cout << solve(0,0) + solve(0,1) << endl;

    debug() << deb(solve(0,0));
    debug() << deb(solve(0,1));
    
    return 0;
}

