#include <bits/stdc++.h>
using namespace std;
char s[200005], t[200005];
int cn, T, n, m, lr[200005], rl[200005], mx[130], mn[130];
int main() {
  cin.tie(NULL);
  scanf("%s%s", s, t);
  n = strlen(s), m = strlen(t);
  int ct = -1;
  memset(mx, -1, sizeof(mx)), memset(mn, 63, sizeof(mn));
  for (auto i = 0; i <= n - 1; i += 1) {
    if (ct < m - 1 and s[i] == t[ct + 1]) mx[s[i]] = ++ct;
    lr[i] = mx[s[i]];
  }
  ct = m;
  for (auto i = n - 1; i >= 0; i -= 1) {
    if (ct > 0 and s[i] == t[ct - 1]) mn[s[i]] = --ct;
    rl[i] = mn[s[i]];
    if (rl[i] > lr[i]) return printf("No\n"), 0;
  }
  printf("Yes\n");
  return 0;
}
