#include <bits/stdc++.h>
using namespace std;
int front[200005], back[200005];
char a[200005], b[200005];
int pos[200];
int main() {
  while (scanf("%s%s", a + 1, b + 1) != EOF) {
    int l1 = strlen(a + 1), l2 = strlen(b + 1);
    memset(pos, 0, sizeof(pos));
    int j = 1;
    for (int i = 1; i <= l1; i++) {
      if (j <= l2 && a[i] == b[j]) {
        pos[a[i]] = j;
        j++;
      }
      front[i] = pos[a[i]];
    }
    memset(pos, 0, sizeof(pos));
    j = l2;
    for (int i = l1; i > 0; i--) {
      if (j > 0 && a[i] == b[j]) {
        pos[a[i]] = l2 - j + 1;
        j--;
      }
      back[i] = pos[a[i]];
    }
    bool flag = true;
    for (int i = 1; i <= l1 && flag; i++)
      if (front[i] + back[i] <= l2) flag = false;
    puts(flag ? "Yes" : "No");
  }
  return 0;
}
