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
#include<bits/stdc++.h>
#include<string>
using namespace std;
typedef long long int ll;
typedef unsigned long long llu;
typedef long double ldo;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vpll;
typedef vector<string> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<int>> vvi;
#define f1(iter,n)  for(ll iter=0;iter<n;++iter)
#define f2(iter,s,e)    for(ll iter=s;iter<e;++iter)
#define f2r(iter,s,e)   for(ll iter=s;iter>=e;--iter)
#define MOD             (llu)1000000007
#define pp              pair<ll,ll>
#define vi              vector<int>
#define vll             vector<ll>
#define vpp             vector<pp>
#define vss             vector<string>
#define take(A,n)       {f1(iter,n)cin>>A[iter];}
#define pb              push_back
#define pob             pop_back
#define eb              emplace_back
#define pf              push_front
#define pof             pop_front
#define mkp             make_pair
#define all(a)          a.begin(),a.end()
#define ff              first
#define ss              second
#define lcm(a,b)        (a*b)/__gcd(a,b)
#define bs(v,x)         binary_search(all(v),x)
#define ub(v,x)         upper_bound(all(v),x)
#define lb(v,x)         lower_bound(all(v),x)
#define zoom            ios_base::sync_with_stdio(false);cin.tie(NULL);
// vvi gph(2e5+10);
// int ans=0;
// int DFS(int sv,int p)
// {
//     int tch=1;
//     for(int i:gph[sv])
//     {
//         if(i!=p){
//             tch+=DFS(i,sv);
//         }
//     }
//     if(tch%2==0)
//     {
//         ans++;
//         tch=0;
//     }
//     return tch;
// }
int main() 
{ 
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    zoom
    int t=1;//cin>>t;
    while(t--)
    {
        int n;cin>>n;
        int *arr = new int[n];
        string swap;
        take(arr,n);
        cin>>swap;
        int i=0;
        while(i<n-1){
            if(swap[i]=='1')
            {
                int j=i+1;
                while(j<(n-1) && swap[j]=='1')
                {
                    j++;
                }
                sort(arr+i,arr+j+1);
                i=j;
            }
            else
            {
                i++;
            }
        }
        for(int i=1;i<n;i++){
            if(arr[i-1]>arr[i]){
                cout<<"NO"<<endl;
                return 0;
            }
        }
        cout<<"YES"<<endl;
    }
    return 0;
}