#include <bits/stdc++.h>
const int MOD = 1E9 + 7;
const int N = 500000 + 5;
const int dx[] = {-1, 1, 0, 0, -1, -1, 1, 1};
const int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
using namespace std;
char s[N], t[N];
int bucketS[N], bucketT[N];
int pre[N], suf[N];
int main() {
  scanf("%s", s);
  scanf("%s", t);
  int sLen = strlen(s);
  int tLen = strlen(t);
  for (int i = 0, j = 0; i < sLen; i++) {
    if (s[i] == t[j] && j < tLen) {
      bucketS[s[i]] = j;
      j++;
    }
    pre[i] = bucketS[s[i]];
  }
  for (int i = sLen - 1, j = tLen - 1; i >= 0; i--) {
    if (j >= 0 && s[i] == t[j]) {
      bucketT[s[i]] = tLen - j;
      j--;
    }
    suf[i] = bucketT[s[i]];
  }
  bool flag = true;
  for (int i = 0; i < sLen; i++) {
    if (pre[i] + suf[i] < tLen) {
      flag = false;
      break;
    }
  }
  if (flag)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
