#C2888. Taco Substring Detection

    ID: 46253 Type: Default 1000ms 256MiB

Taco Substring Detection

Taco Substring Detection

Given a pattern string and a text string, determine whether the pattern is a substring of the text.

If the pattern is found in the text, output YES; otherwise, output NO.

Note: The pattern is considered a substring if it appears consecutively at any position within the text.

Examples:

  • Pattern: "abc", Text: "abcdefg" → Output: YES
  • Pattern: "hello", Text: "worldhello" → Output: YES
  • Pattern: "abc", Text: "defghijk" → Output: NO

inputFormat

The input consists of two lines read from standard input:

  1. The first line contains the pattern string.
  2. The second line contains the text string.

Both strings consist of printable characters.

outputFormat

Output a single line to standard output. Print YES if the pattern is found in the text, otherwise print NO.

## sample
abc
abcdefg
YES