#include <bits/stdc++.h>
using namespace std;
const int MAX = 200005;
int le[MAX], ri[MAX];
vector<int> v[30];
int main() {
  ios::sync_with_stdio(false);
  memset(le, 127, sizeof(le));
  memset(ri, -1, sizeof(ri));
  string s, t;
  cin >> s >> t;
  int n = s.length();
  int m = t.length();
  ri[m] = 1000000000;
  int p1 = 0, p2 = 0;
  while (p1 < n && p2 < m) {
    if (s[p1] == t[p2]) {
      le[p2] = p1;
      p2++;
    }
    p1++;
  }
  p1 = n - 1, p2 = m - 1;
  while (p1 >= 0 && p2 >= 0) {
    if (s[p1] == t[p2]) {
      ri[p2] = p1;
      p2--;
    }
    p1--;
  }
  for (int i = 0; i < m; i++) v[t[i] - 'a'].push_back(i);
  for (int i = 0; i < n; i++) {
    int c = s[i] - 'a';
    if (v[c].empty()) {
      cout << "No" << endl;
      return 0;
    }
    if (v[c][0] > i) {
      cout << "No" << endl;
      return 0;
    }
    int l = 0, r = v[c].size();
    while (r - l > 1) {
      int mid = (l + r) / 2;
      if (le[v[c][mid]] <= i)
        l = mid;
      else
        r = mid;
    }
    int pos = v[c][l] + 1;
    if (ri[pos] <= i) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
