#include <bits/stdc++.h> using namespace std; int main(){ string pai,op; cin>>pai>>op; int len = op.size(); switch(len < 5) { case true: { if(pai.size() < len){ cout<<"NO"; return 0; } for(int i = 0; i <= pai.size() - len; i++) { if(pai[i] > op[0] && count(pai.begin(),pai.end(),pai[i]) >= len){ cout<<"YES"; return 0; } } cout<<"NO"; return 0; } case false:{ bool flag = true; char last = op[0]; for(int j = 0; j <= op.size() && flag; j++){ for(int i = 0; i <= pai.size(); i++){ if(op[j] < pai[i]){ if(j == 0){ flag = true; last = pai[i]; break; }else{ if(pai[i] == last+1){ flag = true; last = pai[i]; break; }else flag = false; } } flag = false; } } if(flag) cout<<"YES"; else cout<<"NO"; } } }