#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string a, b;
  cin >> a >> b;
  int n = a.size(), m = b.size();
  vector<array<int, 26> > nextc(n + 1), prevc(n + 1);
  nextc[n].fill(n);
  for (int i = n - 1; i >= 0; i--) {
    nextc[i] = nextc[i + 1];
    nextc[i][a[i] - 'a'] = i;
  }
  prevc[0].fill(-1);
  for (int i = 1; i <= n; i++) {
    prevc[i] = prevc[i - 1];
    prevc[i][a[i - 1] - 'a'] = i - 1;
  }
  vector<int> matchr(m + 1, n);
  for (int i = m - 1; i >= 0; i--) {
    matchr[i] = matchr[i + 1];
    if (matchr[i] >= 0) matchr[i] = prevc[matchr[i]][b[i] - 'a'];
  }
  vector<int> subsegment(n, 0);
  {
    int pos = 0;
    for (int i = 0; i < m; i++) {
      pos = nextc[pos][b[i] - 'a'] + 1;
      if (pos > n) {
        cout << "No\n";
        return 0;
      }
      subsegment[pos - 1] = i + 1;
    }
    for (int i = 0; i < n; i++) {
      int c = a[i] - 'a';
      int next = nextc[i + 1][c];
      if (next < n) subsegment[next] = max(subsegment[next], subsegment[i]);
    }
  }
  for (int i = 0; i < n; i++) {
    if (subsegment[i] == 0 || matchr[subsegment[i]] <= i) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}
