#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int k = 1;
  while ((1 << k) <= 300000) k++;
  vector<vector<int> > g(n + 1, vector<int>(k, n));
  vector<int> l(k, n);
  for (int i = n - 1; i >= 0; i--)
    for (int j = 0; j < k; j++)
      if (a[i] & (1 << j)) {
        for (int h = 0; h < k; h++) g[i][h] = min(g[i][h], g[l[j]][h]);
        l[j] = i;
        g[i][j] = i;
      }
  while (q--) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    bool ok = false;
    for (int i = 0; i < k; i++)
      if ((a[y] & (1 << i)) && g[x][i] <= y) {
        ok = true;
        break;
      }
    cout << (ok ? "Shi" : "Fou") << endl;
  }
  return 0;
}
