#include <bits/stdc++.h>
char s[200020], t[200020];
int s_len, t_len;
bool Test() {
  int pos[30];
  memset(pos, -1, sizeof(pos));
  int cur = 0, max = 0;
  for (int i = 0; i < s_len; ++i) {
    int& cv = pos[s[i]];
    if (max < t_len && s[i] == t[max]) {
      if (cv < max) cv = max;
      ++max;
    }
    if (cur == t_len || s[i] != t[cur]) {
      if (cv == -1) return false;
      if (cur > cv + 1) cur = cv + 1;
    } else {
      ++cur;
    }
  }
  return cur == t_len;
}
int main() {
  scanf("%s %s", s, t);
  s_len = strlen(s);
  t_len = strlen(t);
  for (int i = 0; i < s_len; ++i) s[i] -= 'a';
  for (int i = 0; i < t_len; ++i) t[i] -= 'a';
  bool res = Test();
  printf("%s\n", res ? "Yes" : "No");
  return 0;
}
