#include <bits/stdc++.h>
using namespace std;
const int N = 200 * 1000 + 10;
vector<int> vec[30];
int le[N], ri[N];
int main() {
  ios_base::sync_with_stdio(false);
  ;
  string s, t;
  cin >> s >> t;
  int ind = 0;
  for (auto i = (0); i <= (((int)(s).size()) - 1); i++) {
    le[i] = ind;
    if (ind < ((int)(t).size()) && s[i] == t[ind]) ind++;
  }
  ind = ((int)(t).size()) - 1;
  for (auto i = (((int)(s).size()) - 1); i >= (0); i--) {
    ri[i] = ind;
    if (ind >= 0 && s[i] == t[ind]) ind--;
  }
  for (auto i = (0); i <= (((int)(t).size()) - 1); i++)
    vec[t[i] - 'a'].push_back(i);
  for (auto i = (0); i <= (((int)(s).size()) - 1); i++) {
    int x = s[i] - 'a';
    ind = lower_bound((vec[x]).begin(), (vec[x]).end(), ri[i]) - vec[x].begin();
    if (ind == ((int)(vec[x]).size()) || vec[x][ind] > le[i]) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}
