#include <bits/stdc++.h>
using namespace std;
int toInt(string s) {
  istringstream sin(s);
  int t;
  sin >> t;
  return t;
}
template <class T>
string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
void chmin(T &t, T f) {
  if (t > f) t = f;
}
template <class T>
void chmax(T &t, T f) {
  if (t < f) t = f;
}
int l[200010], r[200010];
vector<pair<int, int> > v[30];
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++) {
    if (s[i] == p[j]) pos[s[i] - 'a'] = j++;
    if (pos[s[i] - 'a'] == -1) break;
    if (s[i] == p[jj])
      jj++;
    else if (jj > pos[s[i] - 'a'] + 1)
      jj = pos[s[i] - 'a'] + 1;
  }
  int ok = 1;
  if (s[i] || p[j] || p[jj]) ok = 0;
  printf(ok ? "Yes\n" : "No\n");
  return 0;
}
