#include <bits/stdc++.h>
using namespace std;
int n, m;
char a[211111], b[211111];
int p[211111], q[211111];
vector<int> c[26];
int main() {
  gets(a);
  n = strlen(a);
  gets(b);
  m = strlen(b);
  p[0] = a[0] == b[0];
  for (int i = (1); i <= (n - 1); ++i) p[i] = p[i - 1] + (a[i] == b[p[i - 1]]);
  q[n - 1] = (a[n - 1] == b[m - 1]) ? m - 1 : m;
  for (int i = (n - 2); i >= (0); --i) {
    if (q[i + 1] > 0)
      q[i] = q[i + 1] - (a[i] == b[q[i + 1] - 1]);
    else
      q[i] = q[i + 1];
  }
  for (int i = 0; i < (m); ++i) c[b[i] - 'a'].push_back(i);
  bool ok = true;
  for (int i = 0; i < (n); ++i) {
    vector<int>::iterator up =
        lower_bound((c[a[i] - 'a']).begin(), (c[a[i] - 'a']).end(), q[i]);
    if (up == c[a[i] - 'a'].end()) {
      ok = false;
      break;
    }
    int t = *up;
    int rr = i ? p[i - 1] : 0;
    if (t > rr) {
      ok = false;
      break;
    }
  }
  puts(ok ? "Yes" : "No");
  return 0;
}
