#include <bits/stdc++.h>
const int N = 2 * (int)(1e5) + 10;
int a[N], b[N];
char s[N], t[N];
std::vector<int> pos[30];
int main() {
  scanf("%s%s", s, t);
  int lens = strlen(s), lent = strlen(t);
  a[0] = (s[0] == t[0]);
  for (int i = 1; i < lens; ++i) {
    a[i] = a[i - 1];
    if (s[i] == t[a[i - 1]]) ++a[i];
  }
  for (int i = 0; i < lent; ++i) pos[t[i] - 'a'].push_back(i + 1);
  for (int i = 0; i < lent / 2; ++i) std::swap(t[i], t[lent - i - 1]);
  b[lens - 1] = (s[lens - 1] == t[0]);
  for (int i = lens - 2; i >= 0; --i) {
    b[i] = b[i + 1];
    if (s[i] == t[b[i + 1]]) ++b[i];
  }
  bool f = true;
  int c;
  int L, R, l, r, mid;
  for (int i = 0; i < lens; ++i) {
    c = s[i] - 'a';
    L = lent - b[i + 1];
    R = 1;
    if (i >= 1) R = a[i - 1] + 1;
    if (R < L || pos[c].size() == 0) {
      f = false;
      break;
    }
    l = -1, r = pos[c].size() - 1;
    while (r - l > 1) {
      int mid = (l + r) >> 1;
      if (pos[c][mid] >= L)
        r = mid;
      else
        l = mid;
    }
    if (pos[c][r] < L || pos[c][r] > R) {
      f = false;
      break;
    }
  }
  if (f)
    puts("Yes");
  else
    puts("No");
  return 0;
}
