#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 5;
int L[N], R[N], f[30];
int main() {
  string s, t;
  cin >> s >> t;
  memset(f, -1, sizeof(f));
  memset(L, -1, sizeof(L));
  memset(R, -1, sizeof(R));
  f[t[0] - 'a'] = 0;
  for (int i = 0; i < s.length(); i++) {
    if (f[s[i] - 'a'] != -1) {
      L[i] = f[s[i] - 'a'];
      if (f[s[i] - 'a'] + 1 < t.length()) {
        int ff = t[f[s[i] - 'a'] + 1] - 'a';
        f[ff] = max(f[ff], f[s[i] - 'a'] + 1);
      }
    }
  }
  memset(f, -1, sizeof(f));
  f[t[t.length() - 1] - 'a'] = t.length() - 1;
  for (int i = s.length() - 1; i >= 0; i--) {
    if (f[s[i] - 'a'] != -1) {
      R[i] = f[s[i] - 'a'];
      if (f[s[i] - 'a'] - 1 >= 0) {
        int ff = t[f[s[i] - 'a'] - 1] - 'a';
        if (f[ff] == -1)
          f[ff] = f[s[i] - 'a'] - 1;
        else
          f[ff] = min(f[ff], f[s[i] - 'a'] - 1);
      }
    }
  }
  int fk = 0;
  for (int i = 0; i < s.length(); i++) {
    if (L[i] == -1 || R[i] == -1 || L[i] < R[i]) {
      fk = 1;
      break;
    }
  }
  if (fk)
    puts("No");
  else
    puts("Yes");
  return 0;
}
