#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
template <class _T>
inline _T low(_T n) {
  return n & (-n);
}
template <class _T>
inline void swapp(_T &x, _T &y) {
  _T t;
  t = x, x = y, y = t;
}
template <class _T>
inline _T minn(_T i, _T j) {
  return i > j ? j : i;
}
template <class _T>
inline _T maxx(_T i, _T j) {
  return i > j ? i : j;
}
template <class _T>
inline _T gcd(_T b, _T c) {
  return b && c ? (c ? gcd(c, b % c) : b) : b | c;
}
template <class _T>
inline _T abss(_T b) {
  return b > 0 ? b : -b;
}
char str[200005], c[200005];
int dpx[200005], dpy[200005];
pair<char, int> z[200005];
int main() {
  scanf("%s%s", str, c);
  int n = strlen(str), m = strlen(c), i, j;
  j = 0;
  for (i = 0; i < n; i++) {
    dpx[i] = j;
    if (j < m && c[j] == str[i]) j++;
  }
  j = 0;
  for (i = n - 1; i >= 0; i--) {
    dpy[i] = j;
    if (j < m && str[i] == c[m - 1 - j]) j++;
  }
  for (i = 0; i < m; i++) {
    z[i].first = c[i];
    z[i].second = i;
  }
  sort(z, z + m);
  bool flag = true;
  for (i = 0; i < n; i++) {
    if (m - 1 - dpy[i] <= dpx[i]) {
      pair<char, int> x(str[i], dpx[i]), y(str[i], m - 1 - dpy[i]);
      if (upper_bound(z, z + m, x) - lower_bound(z, z + m, y) <= 0) {
        flag = false;
        break;
      }
    } else {
      flag = false;
      break;
    }
  }
  if (flag)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
