#include <bits/stdc++.h>
const int MAX = 3e5 + 7;
const int MOD = 1e9 + 7;
using namespace std;
int n, q;
int v[MAX];
int f[MAX][20], g[MAX][20];
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) cin >> v[i];
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 20; j++)
      if ((v[i - 1] >> j) & 1)
        g[i][j] = i - 1;
      else
        g[i][j] = g[i - 1][j];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 20; j++) {
      for (int k = 0; k < 20; k++) {
        if ((v[i] >> k) & 1) {
          int pre = g[i][k];
          if ((v[pre] >> j) & 1) f[i][j] = max(f[i][j], pre);
          f[i][j] = max(f[i][j], f[pre][j]);
        }
      }
    }
  }
  while (q--) {
    int l, r;
    bool ans = false;
    cin >> l >> r;
    for (int i = 0; i < 20; i++)
      if (((v[l] >> i) & 1) && f[r][i] >= l) ans = true;
    if (ans)
      cout << "Shi" << '\n';
    else
      cout << "Fou" << '\n';
  }
  return 0;
}
