#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  int left[200001], right[200001];
  memset(left, -1, sizeof(left));
  memset(right, -1, sizeof(right));
  int n[27];
  memset(n, -1, sizeof(n));
  cin >> a >> b;
  for (int i = 0, j = 0; i < a.size(); i++) {
    if (a[i] == b[j] && j <= b.size()) {
      left[i] = n[a[i] - 'a'] = j;
      j++;
    } else
      left[i] = n[a[i] - 'a'];
  }
  memset(n, -1, sizeof(n));
  for (int i = a.size() - 1, j = b.size() - 1; i >= 0; i--) {
    if (a[i] == b[j] && j >= 0) {
      right[i] = n[a[i] - 'a'] = j;
      j--;
    } else
      right[i] = n[a[i] - 'a'];
  }
  bool f = 0;
  for (int i = 0; i < a.size(); i++) {
    if (right[i] == -1 || left[i] == -1 || left[i] < right[i]) {
      f = 1;
      cout << "No" << endl;
      break;
    }
  }
  if (f == 0) cout << "Yes" << endl;
  return 0;
}
