#pragma GCC optimize("Ofast,unroll-loops")
#define int long long
#include <map>
#include <set>
#include <array>
#include <cmath>
#include <deque>
#include <bitset>
#include <random>
#include <string>
#include <vector>
#include <cassert>
#include <complex>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
using namespace std;
const int K = 163;
const int MAXN = 400400;
int n;
long long fenw[MAXN];
void add(int i, long long x) {
for (; i < 2 * n; i = (i | (i + 1)))
fenw[i] += x;
}
long long get(int i) {
long long ans = 0;
for (; i >= 0; i = (i & (i + 1)) - 1)
ans += fenw[i];
return ans;
}
long long get(int l, int r) {
return get(r - 1) - get(l - 1);
}
int gcd(int a, int b) {
while (b) {
a %= b;
swap(a, b);
}
return a;
}
int tree_gcd[(1 << 19) + 228];
void build(int v, int left, int right, vector<int>& A) {
if (left + 1 == right) {
tree_gcd[v] = A[left];
return;
}
int mid = (left + right) / 2;
build(2 * v + 1, left, mid, A);
build(2 * v + 2, mid, right, A);
tree_gcd[v] = gcd(tree_gcd[2 * v + 1], tree_gcd[2 * v + 2]);
}
int get_gcd(int v, int left, int right, int x, int y) {
if (y <= left || right <= x)
return 0;
if (x <= left && right <= y)
return tree_gcd[v];
int mid = (left + right) / 2;
return gcd(get_gcd(2 * v + 1, left, mid, x, y), get_gcd(2 * v + 2, mid, right, x, y));
}
constexpr int MOD = 1050000011;
int add(int a, int b) {
return a + b >= MOD ? a + b - MOD : a + b;
}
int sub(int a, int b) {
return a >= b ? a - b : a + MOD - b;
}
int mul(int a, int b) {
return (1ll * a * b) % MOD;
}
const int BASE = 547;
int BASEPOW[MAXN];
pair<int, int> combine(const pair<int, int>& A, const pair<int, int>& B) {
return make_pair(add(mul(A.first, BASEPOW[B.second]), B.first), A.second + B.second);
}
const pair<int, int> NONE(0, 0);
int cur_vals[MAXN];
pair<int, int> suff_hashes[MAXN];
pair<int, int> pref_hashes[MAXN];
pair<int, int> get_segm_hash(int left, int right) {
int l = left / K + 1;
int r = right / K;
pair<int, int> ans = suff_hashes[left];
for (int i = l; i < r; ++i)
ans = combine(ans, suff_hashes[i * K]);
ans = combine(ans, pref_hashes[right]);
return ans;
}
void recalc_block(int id) {
id /= K;
pair<int, int> cur_pref = NONE;
for (int i = id * K; i < id * K + K; ++i) {
cur_pref = combine(cur_pref, make_pair((cur_vals[i] + MOD) % MOD, 1));
pref_hashes[i] = cur_pref;
}
pair<int, int> cur_suff = NONE;
for (int i = id * K + K - 1; i >= id * K; --i) {
cur_suff = combine(make_pair((cur_vals[i] + MOD) % MOD, 1), cur_suff);
suff_hashes[i] = cur_suff;
}
}
// bool prime(int x) {
// for (int i = 2; i * i <= x; ++i) {
// if (x%i == 0) return 0;
// }
// return 1;
// }
int main() {
#ifdef DEBUG
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#else
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
#endif
// for (int x = 1e9 + 5e7; ; ++x) {
// if (prime(x)) {
// cout << x << '\n';
// return 0;
// }
// }
BASEPOW[0] = 1;
for (int i = 1; i < MAXN; ++i)
BASEPOW[i] = mul(BASEPOW[i - 1], BASE);
int m, q;
cin >> n >> m >> q;
vector<long long> A(n);
for (int i = 0; i < n; ++i)
cin >> A[i];
vector<int> B(m);
for (int i = 0; i < m; ++i)
cin >> B[i];
build(0, 0, m, B);
vector<pair<pair<int, int>, int>> queries(q);
vector<int> interesting;
for (int i = 0; i < q; ++i) {
char c;
cin >> c;
if (c == 'U') {
int p, v;
cin >> p >> v;
--p;
queries[i] = make_pair(make_pair(p, v), -1);
} else {
int l, r, s, t;
cin >> l >> r >> s >> t;
--l;
--r;
--s;
--t;
int k = gcd(r - l + 1, get_gcd(0, 0, m, s, t + 1));
if (k <= K)
interesting.emplace_back(k);
queries[i] = make_pair(make_pair(l, r), k);
}
}
vector<bool> ans(q);
sort(interesting.begin(), interesting.end());
interesting.resize(unique(interesting.begin(), interesting.end()) - interesting.begin());
vector<long long> cur_a;
for (int k : interesting) {
cur_a = A;
fill(fenw, fenw + 2 * n, 0);
auto get_real_id = [k](int i) {
return (i % k) * (n / k + 1) + i / k;
};
for (int i = 0; i < n; ++i) {
add(get_real_id(i), cur_a[i] - (i == 0 ? 0 : cur_a[i - 1]));
}
for (int j = 0; j < q; ++j) {
if (queries[j].second == -1) {
// upd
int i = queries[j].first.first;
int x = queries[j].first.second;
add(get_real_id(i), x - cur_a[i]);
if (i + 1 < n)
add(get_real_id(i + 1), cur_a[i] - x);
cur_a[i] = x;
} else if (queries[j].second == k) {
// query
int l = queries[j].first.first;
int r = queries[j].first.second;
ans[j] = true;
for (int i = 1; i < k; ++i) {
// l + i
long long cur_sum = get(get_real_id(l + i), get_real_id(r + 1 - k + i) + 1);
if (cur_sum != 0)
ans[j] = false;
}
long long cur_sum = get(get_real_id(l), get_real_id(r + 1 - k) + 1) + (l == 0 ? 0 : cur_a[l - 1]) - cur_a[r];
if (cur_sum != 0)
ans[j] = false;
}
}
}
for (int i = 0; i < n; ++i)
cur_vals[i] = A[i] - (i == 0 ? 0 : A[i - 1]);
for (int i = 0; i < n; i += K)
recalc_block(i);
cur_a = A;
for (int j = 0; j < q; ++j) {
if (queries[j].second == -1) {
// upd
int i = queries[j].first.first;
int x = queries[j].first.second;
cur_vals[i] += x - cur_a[i];
if (i + 1 < n)
cur_vals[i + 1] += cur_a[i] - x;
cur_a[i] = x;
recalc_block(i);
if ((i + 1) / K != i / K)
recalc_block(i + 1);
} else if (queries[j].second > K) {
// query
int l = queries[j].first.first;
int r = queries[j].first.second;
int k = queries[j].second;
int total_hash = 0;
for (int i = l; i < r; i += k) {
total_hash = add(total_hash, get_segm_hash(i, i + k - 1).first);
}
int delta = ((l == 0 ? 0 : cur_a[l - 1]) - cur_a[r] + MOD) % MOD;
total_hash = add(total_hash, mul(delta, BASEPOW[k - 1]));
ans[j] = total_hash == 0;
}
}
for (int i = 0; i < q; ++i) {
if (queries[i].second != -1) {
if (ans[i])
cout << "Yes\n";
else
cout << "No\n";
}
}
return 0;
}