#include<bits/stdc++.h>
using namespace std;
bool x(string s , string b , int i , int j){
if(s[i] == b[j]){
return true;
}
}
string s , b;
int n , cnt = 1;
int main(){
cin >> n >> s >> b;
for(int i = 1;i <= n;i++){
if(x(s,b,cnt,i)){
cnt++;
}
}
if(n == cnt){
cout << "Yes";
}else{
cout << "No";
}
return 0;
}