#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long long int MOD = 1000000007;
long long int min(long long int a, long long int b) {
  if (b <= a) return b;
  return a;
}
long long int max(long long int a, long long int b) {
  if (a >= b) return a;
  return b;
}
long long int add(long long int x, long long int y) {
  x += y;
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
  return x;
}
long long int multiply(long long int x, long long int y) {
  return (x * 1ll * y) % MOD;
}
long long int power(long long int x, long long int y) {
  long long int z = 1;
  while (y) {
    if (y & 1) z = multiply(z, x);
    x = multiply(x, x);
    y >>= 1;
  }
  return z;
}
long long int modInverse(long long int x) { return power(x, MOD - 2); }
long long int divide(long long int x, long long int y) {
  return multiply(x, modInverse(y));
}
void BOOST() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const int N = 3e5 + 7;
const int LG = 19;
int go[N][LG];
int a[N];
int last[LG];
int main() {
  BOOST();
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 0; j < LG; j++) {
    go[n][j] = n;
    last[j] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < LG; j++) {
      go[i][j] = n;
    }
    for (int j = 0; j < LG; j++) {
      if ((a[i] >> j) & 1) {
        for (int k = 0; k < LG; k++) go[i][k] = min(go[i][k], go[last[j]][k]);
        last[j] = i;
        go[i][j] = i;
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    bool good = false;
    for (int j = 0; j < LG; j++) {
      good |= (((a[y] >> j) & 1) && go[x][j] <= y);
    }
    cout << (good ? "Shi" : "Fou") << '\n';
  }
}
