#include <bits/stdc++.h>
using namespace std;
string s, t;
long long n, m, i, j, l[200005], r[200005], first, dr;
vector<long long> v[200005];
void no() {
  cout << "No";
  exit(0);
}
long long ok(char c, long long dr, long long m) { return v[c][m] <= dr; }
long long cb(char c, long long dr) {
  if (v[c].empty()) return -1;
  long long l = 0, r = v[c].size() - 1;
  while (l != r) {
    long long m = (l + r + 1) / 2;
    if (ok(c, dr, m))
      l = m;
    else
      r = m - 1;
  }
  return l;
}
int main() {
  cin >> s >> t;
  n = s.size();
  m = t.size();
  s = "0" + s;
  t = "0" + t;
  for (i = 1; i <= m; ++i) v[t[i] - 'a'].push_back(i);
  j = 1;
  for (i = 1; i <= n; ++i) {
    l[i] = l[i - 1];
    if (j <= m && t[j] == s[i]) ++l[i], ++j;
  }
  j = m;
  for (i = n; i >= 1; --i) {
    r[i] = r[i + 1];
    if (j >= 1 && t[j] == s[i]) ++r[i], --j;
  }
  for (i = 1; i <= n; ++i) {
    if (l[i] + r[i + 1] < m) no();
    dr = l[i];
    first = m - r[i] + 1;
    long long p = cb(s[i] - 'a', dr);
    if (p == -1 || v[s[i] - 'a'][p] < first || !ok(s[i] - 'a', dr, p)) no();
  }
  cout << "Yes";
  return 0;
}
