#include <bits/stdc++.h>
using namespace std;
char a[200010], b[200010];
int n, m, l[200010], r[200010], last[26];
int main() {
  scanf("%s%s", a, b);
  n = strlen(a);
  m = strlen(b);
  int j = 0;
  for (int i = 0; a[i]; ++i)
    if (a[i] == b[j] && j < m) {
      l[i] = j++;
      last[a[i] - 'a'] = l[i];
    } else
      l[i] = last[a[i] - 'a'];
  j = m - 1;
  memset(last, 0, sizeof(last));
  for (int i = n - 1; i >= 0; --i)
    if (a[i] == b[j] && j >= 0) {
      r[i] = m - (j--) - 1;
      last[a[i] - 'a'] = r[i];
    } else
      r[i] = last[a[i] - 'a'];
  bool flag = true;
  for (int i = 0; i < n; ++i) {
    if (l[i] + r[i] < m - 1) {
      flag = false;
      break;
    }
  }
  if (flag)
    puts("Yes");
  else
    puts("No");
  return 0;
}
