#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, M = 1e3 + 10, MOD = 1e9 + 7;
char s[N], p[N];
int l[N][30], r[N][30];
int main() {
  scanf("%s%s", &s, &p);
  int sz1 = strlen(s);
  int sz2 = strlen(p);
  int it = 0;
  for (int i = 0; i < sz1; i++) {
    for (int j = 0; j < 27; j++) {
      if (i != 0) l[i][j] = l[i - 1][j];
    }
    if (s[i] == p[it]) {
      l[i][p[it] - 'a'] = it + 1;
      it++;
    }
  }
  it = sz2 - 1;
  int cntr = 0;
  for (int i = sz1 - 1; i >= 0; i--) {
    for (int j = 0; j < 27; j++) {
      r[i][j] = r[i + 1][j];
    }
    if (s[i] == p[it]) {
      r[i][p[it] - 'a'] = cntr + 1;
      it--;
      cntr++;
    }
  }
  for (int i = 1; i < sz1 - 1; i++) {
    int cc = s[i] - 'a';
    if (l[i][cc] + r[i][cc] < sz2) return printf("No"), 0;
  }
  if (r[0][s[0] - 'a'] < sz2) {
    return printf("No"), 0;
  }
  if (l[sz1 - 1][s[sz1 - 1] - 'a'] < sz2) return printf("No"), 0;
  cout << "Yes";
  return 0;
}
