#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int MAX_N = 200004;
char s[MAX_N], t[MAX_N];
int l[MAX_N], r[MAX_N];
vector<int> p[40];
int read() {
  int x;
  scanf("%d", &x);
  return x;
}
int num(char x) { return x - 'a'; }
bool find(int x, int left, int right) {
  if (left > right) return false;
  int sz = int(p[x].size());
  int l = 0, r = sz - 1;
  while (l <= r) {
    int mid = (l + r) / 2, t = p[x][mid];
    if (t < left)
      l = mid + 1;
    else if (t > right)
      r = mid - 1;
    else
      return true;
  }
  return false;
}
int main() {
  scanf("%s%s", &s, &t);
  int n = strlen(s), m = strlen(t);
  if (n < m) {
    printf("No");
    return 0;
  }
  for (int i = 0; i < int(m); ++i) p[num(t[i])].push_back((i));
  if (s[0] == t[0])
    l[0] = 0;
  else
    l[0] = -1;
  for (int i = int(1); i <= int(n - 1); ++i) {
    l[i] = l[i - 1];
    if (l[i] < m - 1 && s[i] == t[l[i] + 1]) ++l[i];
  }
  if (s[n - 1] == t[m - 1])
    r[n - 1] = m - 1;
  else
    r[n - 1] = m;
  for (int i = int(n - 2); i >= int(0); --i) {
    r[i] = r[i + 1];
    if (r[i] > 0 && s[i] == t[r[i] - 1]) --r[i];
  }
  for (int i = 0; i < int(n); ++i) {
    if (find(num(s[i]), r[i], l[i]) == false) {
      printf("No");
      return 0;
    }
  }
  printf("Yes");
  return 0;
}
