#include <bits/stdc++.h>
#pragma comment(linker, "/stack:30000000")
using namespace std;
using namespace std;
int n, h;
string s, t;
int pos[200010], f[200010], b[200010];
int main() {
  cin >> s >> t;
  for (int i = 0; i < 200010; i++) pos[i] = -200010;
  int curr = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == t[curr]) {
      pos[s[i]] = curr;
      curr++;
    }
    f[i] = pos[s[i]];
  }
  for (int i = 0; i < 200010; i++) pos[i] = 200010;
  curr = (int)t.size() - 1;
  for (int i = (int)s.size() - 1; i >= 0; i--) {
    if (s[i] == t[curr]) {
      pos[s[i]] = curr;
      curr--;
    }
    b[i] = pos[s[i]];
  }
  for (int i = 0; i < s.size(); i++) {
    if (f[i] < b[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
