#include <bits/stdc++.h>
char s[222222];
char t[222222];
int left[222222];
int right[222222];
int lastpos[30];
int m, n;
int main() {
  scanf("%s %s", s, t);
  m = strlen(s);
  n = strlen(t);
  memset(left, -1, sizeof left);
  memset(right, -1, sizeof right);
  int cur = 0;
  memset(lastpos, -1, sizeof lastpos);
  for (int i = 0; i < m; i++) {
    left[i] = lastpos[s[i] - 'a'];
    if (cur < n && s[i] == t[cur]) {
      left[i] = cur;
      cur++;
    }
    lastpos[s[i] - 'a'] = left[i];
  }
  cur = n - 1;
  memset(lastpos, -1, sizeof lastpos);
  for (int i = m - 1; i >= 0; i--) {
    right[i] = lastpos[s[i] - 'a'];
    if (cur >= 0 && s[i] == t[cur]) {
      right[i] = cur;
      cur--;
    }
    lastpos[s[i] - 'a'] = right[i];
  }
  bool ok = true;
  for (int i = 0; i < m; i++) {
    if (left[i] < 0 || right[i] < 0 || left[i] < right[i]) {
      ok = false;
    }
  }
  puts(ok ? "Yes" : "No");
  return 0;
}
