There is unrest in the Galactic Senate. Several thousand solar systems have declared their intentions to leave the Republic. Master Heidi needs to select the Jedi Knights who will go on peacekeeping missions throughout the galaxy. It is well-known that the success of any peacekeeping mission depends on the colors of the lightsabers of the Jedi who will go on that mission. 

Heidi has *n* Jedi Knights standing in front of her, each one with a lightsaber of one of *m* possible colors. She knows that for the mission to be the most effective, she needs to select some contiguous interval of knights such that there are exactly *k*<sub class="lower-index">1</sub> knights with lightsabers of the first color, *k*<sub class="lower-index">2</sub> knights with lightsabers of the second color, ..., *k*<sub class="lower-index">*m*</sub> knights with lightsabers of the *m*-th color. Help her find out if this is possible.
The first line of the input contains *n* (1 ≤ *n* ≤ 100) and *m* (1 ≤ *m* ≤ *n*). The second line contains *n* integers in the range {1, 2, ..., *m*} representing colors of the lightsabers of the subsequent Jedi Knights. The third line contains *m* integers *k*<sub class="lower-index">1</sub>, *k*<sub class="lower-index">2</sub>, ..., *k*<sub class="lower-index">*m*</sub> (with <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/028ad21fa922d9cfdf096d658a7e651e74feddcf.png" style="max-width: 100.0%;max-height: 100.0%;"/>) – the desired counts of lightsabers of each color from 1 to *m*.
none
5 2
1 1 2 2 1
1 2
YES
1 1
1
1
YES
2 1
1 1
1
YES
2 1
1 1
2
YES
2 2
1 2
1 1
YES
3 3
1 1 3
0 1 2
NO
4 4
2 3 3 2
0 0 1 0
YES
2 2
2 2
0 2
YES
3 3
1 1 3
0 1 1
NO
4 4
2 4 4 3
1 1 1 1
NO
2 2
2 1
0 1
YES
3 3
3 1 1
1 1 1
NO
4 4
1 3 1 4
1 0 0 1
YES
2 2
2 1
1 0
YES
3 3
3 1 1
2 0 0
YES
4 4
4 4 2 2
1 1 1 1
NO
2 2
1 2
0 2
NO
3 3
3 2 3
0 2 1
NO
4 4
1 2 4 2
0 0 1 0
NO
2 2
2 1
1 1
YES
3 3
2 2 1
1 1 1
NO
6 6
5 1 6 3 3 2
1 1 2 0 0 1
YES
4 4
1 2 1 1
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7 7 10 4 4 3 10 2 2 10 2 6 8 8 6 9 5 5 8 2 9 4 1 3 3 1 5 5 6 7 4
0 0 0 0 0 1 1 0 0 0
YES
100 10
10 8 1 2 8 1 4 9 4 10 1 3 1 3 7 3 10 6 8 10 3 10 7 7 5 3 2 10 4 4 7 10 10 6 10 2 2 5 1 1 2 5 10 9 6 9 6 10 7 3 10 7 6 7 3 3 9 2 3 8 2 9 9 5 7 5 8 6 6 6 6 10 10 4 2 2 7 4 1 4 7 4 6 4 6 8 8 6 3 10 2 3 5 2 10 3 4 7 3 10
0 0 0 1 0 0 0 0 1 0
YES
100 10
5 5 6 8 2 3 3 6 5 4 10 2 10 1 8 9 7 6 5 10 4 9 8 8 5 4 2 10 7 9 3 6 10 1 9 5 8 7 8 6 1 1 9 1 9 6 3 10 4 4 9 9 1 7 6 3 1 10 3 9 7 9 8 5 7 6 10 4 8 2 9 1 7 1 7 7 9 1 2 3 9 1 6 7 10 7 9 8 2 2 5 1 1 3 8 10 6 4 2 6
0 0 1 0 0 0 1 0 0 0
NO
100 100
48 88 38 80 20 25 80 40 71 17 5 68 84 16 20 91 86 29 51 37 62 100 25 19 44 58 90 75 27 68 77 67 74 33 43 10 86 33 66 4 66 84 86 8 50 75 95 1 52 16 93 90 70 25 50 37 53 97 44 33 44 66 57 75 43 52 1 73 49 25 3 82 62 75 24 96 41 33 3 91 72 62 43 3 71 13 73 69 88 19 23 10 26 28 81 27 1 86 4 63
3 0 3 2 1 0 0 1 0 2 0 0 1 0 0 2 1 0 2 1 0 0 1 1 3 1 2 1 1 0 0 0 4 0 0 0 2 0 0 1 1 0 3 3 0 0 0 0 1 2 1 2 1 0 0 0 1 1 0 0 0 3 1 0 0 3 1 2 1 1 2 1 2 1 4 0 1 0 0 0 1 1 0 2 0 4 0 1 0 2 2 0 1 0 1 1 1 0 0 1
YES
100 100
98 31 82 85 31 21 82 23 9 72 13 79 73 63 19 74 5 29 91 24 70 55 36 2 75 49 19 44 39 97 43 51 68 63 79 91 14 14 7 56 50 79 14 43 21 10 29 26 17 18 7 85 65 31 16 55 15 80 36 99 99 97 96 72 3 2 14 33 47 9 71 33 61 11 69 13 12 99 40 5 83 43 99 59 84 62 14 30 12 91 20 12 32 16 65 45 19 72 37 30
0 0 0 0 0 0 2 0 0 1 0 0 0 2 1 1 1 1 0 0 1 0 0 0 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 2 0
YES
100 100
46 97 18 86 7 31 2 100 32 67 85 97 62 76 36 88 75 31 46 55 79 37 50 99 9 68 18 97 12 5 65 42 87 86 40 46 87 90 32 68 79 1 40 9 30 50 13 9 73 100 1 90 7 39 65 79 99 86 94 22 49 43 63 78 53 68 89 25 55 66 30 27 77 97 75 70 56 49 54 60 84 16 65 45 47 51 12 70 75 8 13 76 80 84 60 92 15 53 2 3
2 0 0 0 1 0 1 0 3 0 0 1 1 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 2 1 1 0 0 0 0 1 0 1 2 0 1 1 0 1 2 1 0 2 2 0 0 1 1 2 1 0 0 0 1 0 0 1 0 3 1 0 3 0 1 0 0 1 0 2 0 1 1 3 0 0 0 0 1 0 2 2 0 1 2 0 0 0 1 0 0 2 0 2 1
YES
100 100
52 93 36 69 49 37 48 42 63 27 16 60 16 63 80 37 69 24 86 38 73 15 43 65 49 35 39 98 91 24 20 35 12 40 75 32 54 4 76 22 23 7 50 86 41 9 9 91 23 18 41 61 47 66 1 79 49 21 99 29 87 94 42 55 87 21 60 67 36 89 40 71 6 63 65 88 17 12 89 32 79 99 34 30 63 33 53 56 10 11 66 80 73 50 47 12 91 42 28 56
1 0 0 1 0 1 1 0 2 1 1 1 0 0 0 0 1 1 0 0 2 1 2 0 0 0 0 0 1 1 0 2 1 1 0 1 0 0 0 1 2 1 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 1 0 2 0 1 2 1 0 0 0 1 0 1 0 1 1 0 0 2 1 0 0 0 0 0 1 2 1 2 0 1 0 0 1 0 0 0 0 2 0
YES
100 100
95 60 61 26 78 50 77 97 64 8 16 74 43 79 100 37 66 91 1 20 97 70 95 87 42 83 54 66 31 64 57 15 38 76 31 89 76 61 77 22 90 79 59 26 63 60 82 57 3 50 100 9 85 33 32 78 31 50 45 64 93 60 28 84 74 19 51 24 71 32 71 42 77 94 7 81 99 13 42 64 94 65 45 5 95 75 50 100 33 1 46 77 44 81 93 9 39 6 71 93
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
YES
100 100
20 7 98 36 47 73 38 11 46 9 98 97 24 60 72 24 14 71 41 24 77 24 23 2 15 12 99 34 14 3 79 74 8 22 57 77 93 62 62 88 32 54 8 5 34 14 46 30 65 20 55 93 76 15 27 18 11 47 80 38 41 14 65 36 75 64 1 16 64 62 33 37 51 7 78 1 39 22 84 91 78 79 77 32 24 48 14 56 21 2 42 60 96 87 23 73 44 24 20 80
2 0 0 0 0 0 1 0 0 0 1 0 0 2 1 1 0 1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 1 1 1 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 2 2 0 0 0 0 0 0 0 0 0 1 1 1 2 1 1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0
YES
100 100
14 95 7 48 86 65 51 9 5 54 22 58 93 72 31 65 86 27 20 23 24 43 5 78 12 68 60 24 55 55 83 18 1 60 37 62 15 2 5 70 86 93 98 34 45 24 69 66 55 55 74 77 87 55 83 27 46 37 55 12 33 91 1 23 4 78 74 97 8 25 63 63 9 16 60 27 41 18 42 84 35 76 59 8 33 92 40 89 19 23 90 18 30 51 42 62 42 34 75 61
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
YES
100 100
94 78 24 48 89 1 2 22 11 42 86 26 7 23 94 100 82 27 24 28 98 62 12 53 67 43 33 45 13 1 80 99 3 79 71 20 26 35 20 69 45 52 39 48 23 3 80 43 60 90 66 43 54 40 93 35 13 20 90 47 55 39 79 2 61 95 83 60 53 4 55 3 33 74 17 38 78 83 83 94 34 43 34 99 46 71 42 58 65 94 65 64 70 88 49 39 2 36 10 55
0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 1 1 1 0 0 2 0 0 0 1 0 0 0 0 0 1 1 2 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 3 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 1 0
YES
import io, os, sys

pypyin = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
cpyin = sys.stdin.readline
input = pypyin if 'PyPy' in sys.version else cpyin

def strput():
    return input().decode() if 'PyPy' in sys.version else input()

# code starts here

def main():
    n, m = [int(x) for x in input().split()]
    color = [int(x) - 1 for x in input().split()]
    need = [int(x) for x in input().split()]

    for i in range(n):
        cnt = [0] * m
        for j in range(i, n):
            cnt[color[j]] += 1
            if cnt == need:
                print("YES")
                return

    print("NO")


if __name__ == "__main__":
    main()