#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5, M = 19;
int arr[N], nxt[N][M], reach[M][M];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> arr[i];
  memset(nxt, '?', sizeof nxt);
  memset(reach, '?', sizeof reach);
  for (int i = n - 1; i >= 0; i--) {
    vector<int> mn(M, n);
    for (int a = 0; a < M; a++) {
      if (arr[i] & (1 << a)) {
        for (int b = 0; b < M; b++) {
          if (arr[i] & (1 << b)) reach[a][b] = i;
          mn[b] = min(mn[b], reach[a][b]);
        }
      }
    }
    for (int a = 0; a < M; a++) {
      if (arr[i] & (1 << a)) {
        for (int b = 0; b < M; b++) {
          reach[a][b] = mn[b];
          nxt[i][b] = mn[b];
        }
      }
    }
  }
  while (q--) {
    int i, j;
    cin >> i >> j;
    i--, j--;
    bool reachable = 0;
    for (int a = 0; a < M; a++)
      reachable |= (arr[j] & (1 << a)) && nxt[i][a] <= j;
    cout << (reachable ? "Shi" : "Fou") << '\n';
  }
}
