#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
const int N = 300005;
const int B = 20;
int a[N], go[N][B], last[B];
const int inf = 1000000000;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < B; ++i) {
    last[i] = n;
    go[n][i] = n;
  }
  for (int i = n - 1; i >= 0; --i) {
    for (int k = 0; k < B; ++k) go[i][k] = n;
    for (int j = 0; j < B; ++j) {
      if ((a[i] >> j) & 1) {
        for (int k = 0; k < B; ++k) {
          go[i][k] = min(go[i][k], go[last[j]][k]);
        }
        last[j] = i;
        go[i][j] = i;
      }
    }
  }
  for (int i = 0; i < q; ++i) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    bool ok = false;
    for (int i = 0; i < B; ++i) {
      ok |= (((a[y] >> i) & 1) && go[x][i] <= y);
    }
    cout << (ok ? "Shi" : "Fou") << '\n';
  }
  return 0;
}
