#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, q1, w, e, r = 0, t = 0, d[26];
  char a[200001], s[200001];
  scanf("%s%s", a, s);
  q = strlen(a);
  q1 = strlen(s);
  for (w = 0; w < 26; w++) d[w] = -1;
  for (w = 0; w < q; w++) {
    if (a[w] == s[t]) {
      t++;
      d[a[w] - 97] = t;
    }
    if (a[w] == s[r]) r++;
    if (d[a[w] - 97] < r) r = d[a[w] - 97];
    if (r < 0) break;
  }
  if (r < q1)
    printf("No");
  else
    printf("Yes");
  return 0;
}
