#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e5 + 1;
int l[N], r[N], pos[30];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string s, t;
  cin >> s >> t;
  int n = s.size(), m = t.size();
  memset(pos, -1, sizeof pos);
  for (int i = 0, j = 0; i < n; i++) {
    if (j < m && s[i] == t[j])
      l[i] = pos[s[i] - 'a'] = j++;
    else
      l[i] = pos[s[i] - 'a'];
  }
  memset(pos, 0x3f, sizeof pos);
  for (int i = n - 1, j = m - 1; i >= 0; i--) {
    if (j >= 0 && s[i] == t[j])
      r[i] = pos[s[i] - 'a'] = j--;
    else
      r[i] = pos[s[i] - 'a'];
  }
  bool ok = 1;
  for (int i = 0; i < n; i++) ok &= (l[i] >= r[i]);
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
