#include <bits/stdc++.h>
using namespace std;
const int maxK = 300;
vector<int> f(string a, string b) {
  vector<int> cnt(maxK);
  int j = 0;
  int i = 0;
  vector<int> res((int)a.size());
  b.push_back('&');
  for (int j = 0; j < (int)a.size(); j++) {
    if (b[i] == a[j]) {
      cnt[b[i]] = i + 1;
      i++;
    }
    res[j] = cnt[a[j]];
  }
  return res;
}
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  vector<int> a, b;
  a = f(s1, s2);
  reverse(s1.begin(), s1.end());
  reverse(s2.begin(), s2.end());
  b = f(s1, s2);
  reverse(b.begin(), b.end());
  int n = (int)s1.size();
  int m = (int)s2.size();
  for (int i = 0; i < n; i++) {
    if (a[i] + b[i] - 1 < m) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
