#include<bits/stdc++.h> using namespace std; int n; int main(){ cin>>n; for(int i=1;i<=n;i++) cin>>n; if(n/2&&n/6) cout<<"NO"<<endl; else cout<<"YES"<<endl; return 0; }