
Copy
Copy

            #include <iostream>
            #include <vector>
            #include <bits/stdc++.h>
            #define rep(i,n) for (int i = 0; i < (n); ++i)
            using namespace std;
            typedef long long ll;
            typedef pair<int,int> P;
             
            int main(){
                int n;
              bool B;
                cin >> n;
                vector<int> v;
                rep(i,n+1){
                    cin>>i;
                  	v.push_back(i);
                }
             if(n==3&&((v[0]==1&&v[1]==2&&v[2]==3)||(v[0]==1&v[1]==3&&v[2]==2)||(v[0]==2&&v[1]==1&&v[2]==3)||(v[0]==2&v[1]==3&&v[2]==1)||(v[0]==3&v[1]==1&&v[2]==2)||(v[0]==3&&v[1]==2&&v[2]==1))){
             cout<<"Yes"<<endl;
             }else{
             cout<<"No"<<endl;
             }
            }