#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const int INF = 1e9;
const int ALP = 26;
int cnt[ALP][MAXN];
char s[MAXN], s2[MAXN];
int dp_l[MAXN], dp_r[MAXN];
void solve() {
  scanf("%s%s", s, s2);
  int n = strlen(s), n2 = strlen(s2);
  if (s2[0] == s[0]) {
    dp_l[0] = 1;
  }
  if (s2[n2 - 1] == s[n - 1]) {
    dp_r[n - 1] = 1;
  }
  for (int i = 1; i < n; i++) {
    dp_l[i] = dp_l[i - 1];
    if (s[i] == s2[dp_l[i - 1]]) {
      dp_l[i]++;
    }
  }
  for (int i = n - 2; i >= 0; i--) {
    dp_r[i] = dp_r[i + 1];
    if (s[i] == s2[n2 - 1 - dp_r[i + 1]]) {
      dp_r[i]++;
    }
  }
  for (int i = 0; i < n2; i++) {
    for (int j = 0; j < ALP && i; j++) {
      cnt[j][i] = cnt[j][i - 1];
    }
    cnt[s2[i] - 'a'][i]++;
  }
  for (int i = 0; i < n; i++) {
    int l = n2 - dp_r[i + 1] - 1;
    int r = i ? dp_l[i - 1] : 0;
    r = min(r, n2 - 1);
    int _cnt = cnt[s[i] - 'a'][r];
    if (l > 0) _cnt -= cnt[s[i] - 'a'][l - 1];
    if (_cnt <= 0) {
      printf("No");
      return;
    }
  }
  printf("Yes");
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
