#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string x, y;
  long long a, b, c, d, e, f, i, j, k;
  cin >> x;
  cin >> y;
  a = x.length();
  b = y.length();
  if (a < b) {
    cout << "No";
    return 0;
  }
  vector<vector<long long> > p(26), q(26);
  c = 0;
  for (i = 0; i < a; i++) {
    if (x[i] == y[c]) {
      d = y[c] - 'a';
      p[d].push_back(i);
      c++;
    }
    if (c == b) break;
  }
  if (c != b) {
    cout << "No";
    return 0;
  }
  c = b - 1;
  for (i = a - 1; i >= 0; i--) {
    if (x[i] == y[c]) {
      d = y[c] - 'a';
      q[d].push_back(i);
      c--;
    }
    if (c == -1) break;
  }
  if (c != -1) {
    cout << "No";
    return 0;
  }
  for (i = 0; i < 26; i++) {
    reverse(q[i].begin(), q[i].end());
  }
  vector<long long> u(26, 0);
  for (i = 0; i < a; i++) {
    d = x[i] - 'a';
    c = 0;
    e = u[d];
    if (p[d].size() == 0 || e >= p[d].size()) {
      cout << "No";
      return 0;
    }
    while (e < p[d].size()) {
      if (i >= p[d][e] && i <= q[d][e]) {
        c = 1;
        break;
      }
      e++;
      u[d]++;
    }
    if (c == 0) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
