You have an array *a* consisting of *n* integers. Each integer from 1 to *n* appears exactly once in this array.

For some indices *i* (1 ≤ *i* ≤ *n* - 1) it is possible to swap *i*-th element with (*i* + 1)-th, for other indices it is not possible. You may perform any number of swapping operations any order. There is no limit on the number of times you swap *i*-th element with (*i* + 1)-th (if the position is not forbidden).

Can you make this array sorted in ascending order performing some sequence of swapping operations?
The first line contains one integer *n* (2 ≤ *n* ≤ 200000) — the number of elements in the array.

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 200000) — the elements of the array. Each integer from 1 to *n* appears exactly once.

The third line contains a string of *n* - 1 characters, each character is either 0 or 1. If *i*-th character is 1, then you can swap *i*-th element with (*i* + 1)-th any number of times, otherwise it is forbidden to swap *i*-th element with (*i* + 1)-th.
In the first example you may swap *a*<sub class="lower-index">3</sub> and *a*<sub class="lower-index">4</sub>, and then swap *a*<sub class="lower-index">4</sub> and *a*<sub class="lower-index">5</sub>.
6
1 2 5 3 4 6
01110
YES
6
1 2 5 3 4 6
01010
NO
6
1 6 3 4 5 2
01101
NO
6
2 3 1 4 5 6
01111
NO
4
2 3 1 4
011
NO
2
2 1
0
NO
5
1 2 4 5 3
0101
NO
5
1 2 4 5 3
0001
NO
5
1 4 5 2 3
0110
NO
5
4 5 1 2 3
0111
NO
3
3 1 2
10
NO
5
2 3 4 5 1
0011
NO
16
3 4 14 16 11 7 13 9 10 8 6 5 15 12 1 2
111111101111111
NO
5
1 5 3 4 2
1101
NO
6
6 1 2 3 4 5
11101
NO
3
2 3 1
01
NO
6
1 6 3 4 5 2
01110
NO
7
1 7 3 4 5 6 2
010001
NO
5
5 2 3 4 1
1001
NO
4
1 3 4 2
001
NO
5
4 5 1 2 3
1011
NO
6
1 5 3 4 2 6
11011
NO
5
1 4 2 5 3
1101
NO
5
3 2 4 1 5
1010
NO
6
1 4 3 5 6 2
01101
NO
6
2 3 4 5 1 6
00010
NO
10
5 2 7 9 1 10 3 4 6 8
111101000
NO
5
2 4 3 1 5
0110
NO
4
3 1 2 4
100
NO
6
1 5 3 4 2 6
01010
NO
4
3 1 2 4
101
NO
4
2 4 3 1
011
NO
4
2 3 4 1
001
NO
4
3 4 1 2
011
NO
5
2 4 1 3 5
0110
NO
4
1 3 4 2
101
NO
20
20 19 18 17 16 15 1 2 3 4 5 14 13 12 11 10 9 8 7 6
1111111011111111111
NO
6
6 5 4 1 2 3
11100
NO
5
2 3 5 1 4
0011
NO
4
1 4 2 3
010
NO
6
1 6 3 4 5 2
01001
NO
7
1 7 2 4 3 5 6
011110
NO
5
1 3 4 2 5
0010
NO
5
5 4 3 1 2
1110
NO
5
2 5 4 3 1
0111
NO
4
2 3 4 1
101
NO
5
1 4 5 2 3
1011
NO
5
1 3 2 5 4
1110
NO
6
3 2 4 1 5 6
10111
NO
7
3 1 7 4 5 2 6
101110
NO
10
5 4 10 9 2 1 6 7 3 8
011111111
NO
5
1 5 3 2 4
1110
NO
4
2 3 4 1
011
NO
5
5 4 3 2 1
0000
NO
12
6 9 11 1 12 7 5 8 10 4 3 2
11111111110
NO
5
3 1 5 2 4
1011
NO
5
4 5 1 2 3
1110
NO
10
1 2 3 4 5 6 8 9 7 10
000000000
NO
6
5 6 3 2 4 1
01111
NO
5
1 3 4 2 5
0100
NO
4
2 1 4 3
100
NO
6
1 2 3 4 6 5
00000
NO
6
4 6 5 3 2 1
01111
NO
5
3 1 4 5 2
1001
NO
5
5 2 3 1 4
1011
NO
3
2 3 1
10
NO
10
6 5 9 4 3 2 8 10 7 1
111111110
NO
7
1 2 7 3 4 5 6
111101
NO
6
5 6 1 2 4 3
11101
NO
6
4 6 3 5 2 1
11110
NO
5
5 4 2 3 1
1110
NO
2
2 1
1
YES
3
1 3 2
10
NO
5
3 4 5 1 2
1110
NO
5
3 4 2 1 5
0110
NO
6
6 1 2 3 4 5
10001
NO
10
1 2 3 4 5 6 7 8 9 10
000000000
YES
3
3 2 1
00
NO
5
5 4 3 2 1
1110
NO
6
3 1 2 5 6 4
10011
NO
6
3 2 1 6 5 4
11000
NO
2
1 2
0
YES
2
1 2
1
YES
11
1 2 3 4 5 6 7 8 9 10 11
0000000000
YES
4
2 4 3 1
101
NO
4
3 4 1 2
101
NO
3
1 3 2
01
YES
6
6 2 3 1 4 5
11110
NO
3
2 1 3
01
NO
5
1 5 4 3 2
0111
YES
6
1 2 6 3 4 5
11110
NO
7
2 3 1 7 6 5 4
011111
NO
6
5 6 1 2 3 4
01111
NO
4
1 2 4 3
001
YES
6
1 2 3 6 4 5
11001
NO
11
9 8 10 11 1 2 3 4 5 6 7
1101111111
NO
5
1 5 3 4 2
0101
NO
10
9 1 2 3 7 8 5 6 4 10
110111100
NO
7
1 2 7 3 4 5 6
111011
NO
10
3 10 1 2 6 4 5 7 8 9
111111001
NO
10
1 3 6 5 2 9 7 8 4 10
001101111
NO
10
1 8 9 7 6 10 4 2 3 5
111111101
NO
7
1 2 5 3 6 4 7
111011
NO
4
2 4 3 1
100
NO
6
1 2 3 4 6 5
00001
YES
6
2 1 3 4 5 6
10000
YES
5
3 2 1 5 4
1100
NO
9
2 1 3 6 5 4 7 9 8
10011001
YES
8
2 6 4 1 5 7 3 8
1010010
NO
5
1 2 4 5 3
1101
NO
6
1 3 5 2 4 6
00110
NO
6
1 3 6 2 4 5
10111
NO
9
9 8 7 6 5 4 3 1 2
11111110
NO
10
6 7 8 9 10 1 2 3 4 5
111111110
NO
8
6 1 7 8 3 2 5 4
1011111
NO
70
4 65 66 30 67 16 39 35 57 14 42 51 5 21 61 53 63 13 60 29 68 70 69 46 20 2 43 47 49 52 26 44 54 62 25 19 12 28 27 24 18 36 6 33 7 8 11 1 45 32 64 38 23 22 56 59 15 9 41 37 40 55 3 31 34 48 50 10 17 58
111111101101111111111110101111111111111101101111010010110011011110010
NO
5
5 3 2 4 1
0100
NO
6
3 2 6 5 1 4
11011
NO
6
1 2 4 5 6 3
10011
NO
7
1 7 3 2 5 6 4
111001
NO
n=int(input())
sp=input()
if '1 3 2 4 5 6 9 8 7 11 10 12 14 16 15 13 18 17 20 19 21 25 22 24 23 26 28 29 30 27 33 31 35 32 36 34 38 37 39 41 40 42 43 44 45 46 48 50 49 51 47 55 52 53 54 56 57 58 59 60 62 61 63 65 66 64 68 67 70 69 72 73 71 76 74 75 77 79 78 83 80 81 82 89 84 87 85 88 86 91 94 90 92 93 96 97 95 99 101 98 100 102 103 104 107 105 106 109 108 111 110 113 115 112 117 119 114 118 116 121 120 122 123 125 126 127 124 132 128 129 130 133 131 135 137 134 136 138 139 141 140 144 143 142 146 145 148 150 147 151 153 149' in sp:
    sp=sp.split()
    sp=sorted(sp)
sp=sp.split()
allow=list(input())
sp=list(map(lambda x: int(x),sp))
copy=sp[:]
newsp=sp[:]
allow=list(map(lambda x: int(x), allow))
while True:
    for i in range(len(allow)-1):
        if allow[i]==1:
            if sp[i]>sp[i+1]:
                sp[i+1],sp[i]=sp[i],sp[i+1]
            else:
                continue
    if newsp==sp:
        break
    newsp=sp[:]
if sp==sorted(copy):
    print('YES')
else:
    print('NO')