#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmax(T &x, T y) {
  if (x < y) x = y;
}
template <class T>
inline void checkmin(T &x, T y) {
  if (x > y) x = y;
}
template <class T>
inline T Min(T x, T y) {
  return (x > y ? y : x);
}
template <class T>
inline T Max(T x, T y) {
  return (x < y ? y : x);
}
template <class T>
inline T Abs(T x) {
  return (x > 0 ? x : (-x));
}
using namespace std;
char s[200005], p[200005];
int main() {
  scanf("%s%s", s, p);
  int i, j = 0, jj = 0, pos[30] = {0}, m;
  for (i = 0; i < 30; i++) pos[i] = -1;
  for (i = 0; s[i]; i++) {
    m = 0;
    if (s[i] == p[j]) pos[s[i] - 'a'] = j++, m = 1;
    if (s[i] == p[jj]) jj++, m = 1;
    if (pos[s[i] - 'a'] == -1) break;
    if (m == 0 && jj > pos[s[i] - 'a'] + 1) jj = pos[s[i] - 'a'] + 1;
  }
  int ok = 1;
  if (s[i] || p[jj]) ok = 0;
  printf(ok ? "Yes\n" : "No\n");
  return 0;
}
