#include <bits/stdc++.h>
using namespace std;
bool have[26][200001], li[26][26];
char str1[200001], str2[200001];
int n, m, f[26], d[200001], cur[26];
vector<int> g[26];
vector<int> ll[26][26];
int max(int a, int b) { return (a > b) ? a : b; }
void build() {
  int i;
  for (i = 0; i < m - 1; i++) {
    li[str2[i + 1] - 'a'][str2[i] - 'a'] = true;
    ll[str2[i + 1] - 'a'][str2[i] - 'a'].push_back(i + 1);
  }
  for (i = 0; i < m; i++) g[str2[i] - 'a'].push_back(i);
  for (i = 0; i < 26; i++) cur[i] = g[i].size() - 1;
}
int find(int s, int t, int p) {
  int l = 0, r = ll[s][t].size() - 1, mid;
  while (l < r) {
    mid = (l + r) / 2;
    if (ll[s][t][mid] < p)
      l = mid + 1;
    else
      r = mid;
  }
  if (ll[s][t][l] <= p) return ll[s][t][l];
  if (l > 0) return ll[s][t][l - 1];
  return 0;
}
void work() {
  int i, j, p, t, pp;
  for (i = 0; i < n; i++) {
    t = 0;
    for (j = 0; j < 26; j++)
      if (li[str1[i] - 'a'][j]) {
        t = max(t, find(str1[i] - 'a', j, f[j]));
      }
    if (t == 0) {
      if (str1[i] == str2[0])
        d[i] = 1;
      else {
        puts("No");
        return;
      }
    } else
      d[i] = t + 1;
    if (d[i] != m) f[str1[i] - 'a'] = max(f[str1[i] - 'a'], d[i]);
  }
  for (i = n - 1; i >= 0; i--) {
    if (d[i] != m && !have[str2[d[i]] - 'a'][d[i] + 1]) {
      puts("No");
      return;
    }
    p = str1[i] - 'a';
    if (cur[p] >= 0 && (g[p][cur[p]] == m - 1 ||
                        have[str2[g[p][cur[p]] + 1] - 'a'][g[p][cur[p]] + 2])) {
      have[p][g[p][cur[p]] + 1] = true;
      cur[p]--;
    }
  }
  for (i = 0; i < 26; i++)
    if (cur[i] >= 0) break;
  if (i < 26)
    puts("No");
  else
    puts("Yes");
}
int main() {
  scanf("%s%s", str1, str2);
  n = strlen(str1);
  m = strlen(str2);
  build();
  work();
  return 0;
}
