#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
const double esp = 1e-8;
const int maxn = 200000 + 10;
int pword[30];
vector<int> word[30];
int v[maxn], bv[maxn], f[maxn];
char s[maxn], t[maxn];
int n, m;
bool gao() {
  memset(v, 0, sizeof(v));
  memset(pword, 0, sizeof(pword));
  memset(f, -1, sizeof(f));
  for (int i = 0; i < (n); ++i) {
    int x = s[i] - 'a';
    int y;
    if (pword[x] > 0) f[i] = word[x][pword[x] - 1];
    if (pword[x] >= ((int)(word[x]).size())) continue;
    y = word[x][pword[x]];
    if (y == 0 || v[y - 1]) {
      v[y] = 1;
      pword[x]++;
      f[i] = y;
    }
  }
  memset(bv, 0, sizeof(bv));
  for (int i = (n - 1); i >= (0); --i) {
    if (f[i] == -1) return false;
    if (f[i] == m - 1 || bv[f[i] + 1])
      ;
    else
      return false;
    int x = s[i] - 'a';
    int y;
    if (pword[x] <= 0) continue;
    if (pword[x] > 0) {
      y = word[x][pword[x] - 1];
      if (y == m - 1 || bv[y + 1]) {
        bv[y] = 1;
        pword[x]--;
      }
    }
  }
  return true;
}
int main() {
  while (scanf("%s%s", s, t) == 2) {
    n = strlen(s);
    m = strlen(t);
    for (int i = 0; i < (27); ++i) word[i].clear();
    for (int i = 0; i < (m); ++i) word[t[i] - 'a'].push_back(i);
    if (gao())
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
