#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  string s, t;
  cin >> s >> t;
  vector<long long> v[26];
  long long n = s.size(), m = t.size();
  for (long long i = 0; i < m; i++) v[t[i] - 'a'].push_back(i);
  long long l[n], r[n];
  long long in = 0;
  for (long long i = 0; i < n; i++) {
    long long z = 0;
    if (i) z = l[i - 1];
    if (in == m) {
      l[i] = z;
    } else {
      if (s[i] == t[in]) {
        l[i] = z + 1;
        in++;
      } else
        l[i] = z;
    }
  }
  in = m - 1;
  for (long long i = n - 1; i >= 0; i--) {
    long long z = 0;
    if (i != n - 1) z = r[i + 1];
    if (in == -1) {
      r[i] = z;
    } else {
      if (s[i] == t[in]) {
        r[i] = z + 1;
        in--;
      } else
        r[i] = z;
    }
  }
  long long f = 0;
  for (long long i = 0; i < n; i++) {
    long long a1 = 0, a2 = 0;
    if (i) a1 = l[i - 1];
    if (i != n - 1) a2 = r[i + 1];
    if (v[s[i] - 'a'].size() == 0) {
      cout << "No";
      return 0;
    }
    auto it = lower_bound((v[s[i] - 'a']).begin(), (v[s[i] - 'a']).end(), a1);
    if (it == v[s[i] - 'a'].end() || *it != a1) it--;
    if ((m - 1 - *it) > a2) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
