#include <bits/stdc++.h>
using namespace std;
int n, m;
string s, t;
int l[200005], r[200005], last[26];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s >> t;
  n = s.length();
  m = t.length();
  int it = m - 1;
  for (int i = 0; i < 26; i++) last[i] = -1;
  for (int is = n - 1; is >= 0; is--) {
    l[is] = -1;
    if (last[s[is] - 'a'] != -1) l[is] = last[s[is] - 'a'];
    if (it >= 0 and t[it] == s[is]) l[is] = it;
    if (it >= 0 and s[is] == t[it]) last[s[is] - 'a'] = it--;
  }
  it = 0;
  for (int i = 0; i < 26; i++) last[i] = -1;
  for (int is = 0; is <= n - 1; is++) {
    r[is] = -1;
    if (last[s[is] - 'a'] != -1) r[is] = last[s[is] - 'a'];
    if (it < m and t[it] == s[is]) r[is] = it;
    if (it < m and s[is] == t[it]) last[s[is] - 'a'] = it++;
  }
  for (int i = 0; i < n; i++)
    if (l[i] == -1 or r[i] == -1 or l[i] > r[i]) {
      cout << "No\n";
      return 0;
    }
  cout << "Yes\n";
  return 0;
}
