#include <bits/stdc++.h>
using namespace std;
int n, m, fr[200005], bk[200005];
char x[200005], y[200005];
vector<int> p[30];
int bs(int id, int xx) {
  int l = 0, r = (int)p[id].size() - 1, mid;
  if (r == -1 || p[id][l] > xx) return -1;
  while (l < r - 1) {
    mid = (l + r) >> 1;
    if (p[id][mid] <= xx)
      l = mid;
    else
      r = mid - 1;
  }
  if (l == r - 1 && p[id][r] <= xx) l++;
  return p[id][l];
}
bool check() {
  int l, r, pos;
  for (int i = 0; i <= n - 1; i++) {
    l = -1;
    if (i) l = fr[i - 1];
    pos = bs(x[i] - 'a', l + 1);
    if (pos == -1) return false;
    r = bk[i + 1];
    if (r > pos + 1) return false;
  }
  return true;
}
int main() {
  while (~scanf("%s%s", x, y)) {
    n = strlen(x);
    m = strlen(y);
    if (x[0] == y[0])
      fr[0] = 0;
    else
      fr[0] = -1;
    bk[n] = m;
    for (int i = 0; i <= 29; i++) p[i].clear();
    for (int i = 0; i <= m - 1; i++) p[y[i] - 'a'].push_back(i);
    for (int i = 1; i <= n - 1; i++) {
      if (fr[i - 1] < m - 1 && x[i] == y[fr[i - 1] + 1])
        fr[i] = fr[i - 1] + 1;
      else
        fr[i] = fr[i - 1];
    }
    for (int i = n - 1; i >= 0; i--) {
      if (bk[i + 1] > 0 && x[i] == y[bk[i + 1] - 1])
        bk[i] = bk[i + 1] - 1;
      else
        bk[i] = bk[i + 1];
    }
    if (check())
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
