#include <bits/stdc++.h>
using namespace std;
char s[300000], t[300000];
int sn, tn;
int f[300000], b[300000];
vector<int> v[30];
int vi[30];
int main() {
  scanf("%s", s);
  sn = strlen(s);
  scanf("%s", t);
  tn = strlen(t);
  int si = 0, ti = 0;
  for (; si < sn; si++) {
    if (s[si] == t[ti]) f[ti++] = si;
    if (ti >= tn) break;
  }
  if (ti < tn) {
    puts("No");
    return 0;
  }
  si = sn - 1;
  ti = tn - 1;
  for (; si >= 0; si--) {
    if (s[si] == t[ti]) b[ti--] = si;
    if (ti < 0) break;
  }
  if (ti > 0) {
    puts("No");
    return 0;
  }
  for (int ti = 0; ti < tn; ti++) v[t[ti] - 'a'].push_back(ti);
  int fi = 0, bi = 0;
  for (int si = 0; si < sn; si++) {
    while (fi < tn && f[fi] < si - 1) fi++;
    while (bi < tn && b[bi] <= si) bi++;
    int p = s[si] - 'a';
    int l = -1, r = v[p].size(), mid;
    while (l + 1 != r) {
      mid = (l + r) / 2;
      if (v[p][mid] < bi - 1)
        l = mid;
      else if (v[p][mid] > fi + 1)
        r = mid;
      else
        goto sf;
    }
    puts("No");
    return 0;
  sf:;
  }
  puts("Yes");
  return 0;
}
