#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  string a, b;
  cin >> a >> b;
  if (b.size() > a.size()) return cout << "No", 0;
  int i = 0, j = 0, j2(0);
  vector<int> jitu(26, -1);
  while (i < a.size()) {
    if (j == b.size()) j--;
    if (j2 < b.size() && a[i] == b[j2]) {
      jitu[a[i] - 'a'] = j2;
      j2++;
    }
    if (a[i] == b[j]) {
      j++;
    } else if (jitu[a[i] - 'a'] == -1)
      return cout << "No", 0;
    else if (jitu[a[i] - 'a'] < j)
      j = jitu[a[i] - 'a'] + 1;
    i++;
  }
  if (j != b.size() || j2 != b.size()) return cout << "No", 0;
  cout << "Yes";
  return 0;
}
